View Full Version : ThePawnDragon's Tech Application
ThePawnDragon
10-12-2009, 04:39 PM
1.) Are you an active member of the Pawn Community, on the game and the forums?
Oh lord, I quit so long ago. But if I do get accepted, I will willingly become active once more on the forums. I'm just tired of playing the actual game.
2.) Do you actively post in the Tech Discussion forum?
I used to, and like I said, I am up for helping anyone who needs it.
3.What area of technology do you consider yourself the most experienced in (hardware, software, programming* , website design**, etc.).
I'd say programming and web design. For a few examples of my knowledge of web design, I know phpBB, CSS, and HTML. For examples, I have osxclan.net and austindrake.org , as well as http://www.ingenrality.byethost16.com/forum. As for my coding skills, I teach courses at my middle school, and I know HTML, PHP, Java, A little C#, and Python.
4.) How old are you? (Don't lie)
I am 13 years of age, going on 14 in November.
5.) In your own words, describe what your job as a Tech Team member would entail.
I would help out as much as I can with my time frames in the IRC, and as for getting more active / posting more in the tech section, I will try my hardest to achieve those.
6.) Why are you interested in becoming a member of the Tech Team?
I was in it in 08 before the reset, and I think it will provide a chance to get better social skills, as well as becoming better at some of my known tech abilities, and perhaps to learn a thing or two from the other techies in the Pawn community. And to help, of course.
7.) Do you submit yourself to this user group and all its rules, understanding that breaking said rules will result in being banned for an undetermined amount of time? (Have to scare the noobs away. :] )
Yes, of course I agree and understand.
9. Did you notice there wasn't a number 10?
This is number 9, we haven't passed 10. Do you mean number 8?
Thanks for your time in reading my application for the tech crew :].
what was your username in 08? also, I want examples of code.
EaEaEa
10-12-2009, 06:50 PM
his name was something like naruto00171, he mass evaded and was banned for a number of months if not over a year.
ThePawnDragon
10-12-2009, 07:52 PM
1. I never evaded a ban.
2. I had like 2 infractions when I first joined.
3. My username was this, and JonDrake I believe.
Example of code: Made it for an IRC bot in Perl.
use IO::Socket;
use Time::HiRes qw( time );
use strict;
my $lastping = time();
my $con = IO::Socket::INET->new(PeerAddr=>'paradox.esper.net',
PeerPort=>'6667',
Proto=>'tcp',
Timeout=>'30') || print "Error! $!\n";
my %bot;
my $chan = "#marketbot";
my $owner = "Injex";
$bot{'commands'} = { #all the commands that can be called, their trigger sub, and required level.
HELP => [\&cmd_help,0],
GETM => [\&cmd_getm,0],
LISTM => [\&cmd_listm,0],
SETM => [\&cmd_setm,1],
MAKEOP => [\&cmd_makeop,2],
};
print $con "USER MarketBot 0 0 : Injex Injex\r\n"; #authenticate as MarketBot
print $con "NICK MarketBot\r\n"; #provide a nick
while(my $answer = <$con>)
{
if($lastping > time()-5){print $con "JOIN $chan\r\n"; $lastping = time();}
print $answer; #Show server reply
if($answer =~ /:(.+)\!/) #strip username from message
{
my $sender = $1;
if($answer =~ /PRIVMSG (.+)/) #if it is a private message...
{
if($1 =~ /:!(\S+)\S?(.*?)/i){
my $cmd = $1;
$cmd = uc($cmd);
my @args = split(/ /,$2);
if(undef($bot{'users'}{$sender}{'admin'})){
$bot{'users'}{$sender}{'admin'} = 0;
}
if (defined($bot{'commands'}{$cmd})) {
$bot{'users'}{'Liam'}{'admin'} = 2; #set global admin
if($bot{'users'}{$sender}{'admin'} >= $bot{'commands'}{$cmd}[1]){
&{$bot{'commands'}{$cmd}[0]}($sender, @args);
}else{
print $con "PRIVMSG $chan :arbot Not high enough level to run command $cmd.\r\n";
}
}
else {print $con "PRIVMSG $chan :arbot Unknown command '$cmd'\r\n"; }
}elsif($answer =~ /LOLWUT/i){
print $con "PRIVMSG $chan :arbot Yes i watch Pr0n and I'm proud of it.\r\n";
}
}
}
if($answer =~ m/^PING (.*?)$/gi) #Answer ping requests
{
print $con "PONG ".$1."\r\n";
}
}
print "Server connection failed!\n";
sub cmd_getm(){
my $sender = shift;
my $user = lc(shift);
my $val = $bot{'users'}{$user}{'dollar'};
print $con "PRIVMSG $chan :arbot $user has $val GALD KOINS\r\n";
}
sub cmd_setm(){
my $sender = shift;
my $user = lc(shift);
my $dollar = shift;
print $con "PRIVMSG $chan :arbot $user now has $dollar GALD KOINS.\r\n"; # !getm Colter
$bot{'users'}{$user}{'dollar'} = $dollar;
}
sub cmd_makeop(){
my $sender = shift;
my $user = lc(shift);
$bot{'users'}{$user}{'admin'} = 1;
print $con "PRIVMSG $chan :arbot $user is now Bot Operator.";
}
#!/usr/bin/perl
# Global search and replace. Greps all files in the dir
# for a string and replaces it.
# Usage glob_rep search_string replace_string.
$search = @ARGV[0];
$replace = @ARGV[1];
@files = `grep -l $search *`;
@files = grep !/not permitted/, @files;
foreach $file (@files) {
open (FILE, $file);
@lines = <FILE>;
close FILE;
open (TEMP, ">temporary.file.name");
foreach $line (@lines) {
$line =~ s/$search/$replace/g ;
print TEMP $line;
}
close TEMP;
`mv -f temporary.file.name $file`;
}
This little utility searches every file in the current directory, and does a global search and replace for you.
ThePawnDragon
10-15-2009, 08:37 PM
Sorry for second reply, but I also know Actionscript 2 and Visual Basic.
vSkyzv
10-16-2009, 09:49 PM
If you can give me a Perl snippet of how to kick somebody who said "Please kick me" and kick them for the reason "You asked for it", then I will accept.
The part that connects to IRC is not needed.
ThePawnDragon
10-16-2009, 11:16 PM
Is this for the IRC, or the PawnGame chat??
Edit: If it's for the IRC, I didn't use Perl. Just basic mIRC Script knowledge.
on @*:TEXT:*:#: {
Please kick me
kick # $nick 4 You asked for it.
}
If it's for the Pawn chat, sorry, but I haven't used sockets before O: But I'll attempt to learn it.
Edit: Here it is in Perl:
use IO::Socket;
use Time::HiRes qw( time );
use strict;
require 'msg.pl';
my $lastping = time();
my $con = IO::Socket::INET->new(PeerAddr=>'irc.esper.net',
PeerPort=>6667,
Proto=>'tcp',
Timeout=>'30') || print "Error: Connection\n";
our %bot;
my $chan = "#kickbot";
my $owner = "Injex";
$bot{'users'}{$owner}{'admin'} = 7;
$bot{'commands'} = { #all the commands that can be called, their trigger sub, and required level. Levels: 0 = anyone, 1 = operator, 2 = owner.
BOTOP => [\&cmd_botop,5],
BOTDEOP => [\&cmd_botdeop,5],
QUIT => [\&cmd_quit, 1],
JOIN => [\&cmd_join, 1],
};
print $con "USER Bot 0 0 : Injex Injex\r\n"; #authenticate as InjexBot
print $con "NICK Bot\r\n"; #provide a nick
while(my $answer = <$con>)
{
if($answer =~ /001/){print $con "JOIN $chan\r\n";}
if($answer =~ /376/){print $con "PRIVMSG NickServ :IDENTIFY x59f3liam\r\n";}
print $answer; #Show server reply
if($answer =~ /:(.+)\!/) #strip username from message
{
my $sender = $1;
if($answer =~ /PRIVMSG .+ :!(\S+)\S*(.*)/) #if it is a private message and has a ! mark...
{
&cmd_parsecmd($sender, $1, $2);
}else{
if($answer =~ /PRIVMSG #(.+) :(.+)/i){
my $achan = $1;
if ($2 =~ /kick me/i){
print $con "PRIVMSG \#$achan :I heard $sender ask for a kick!\r\n";
print $con "KICK \#$achan $sender :You -did- ask for it...\r\n";
}
}
}
}
if($answer =~ m/^PING (.*?)$/gi) #Answer ping requests
{
print $con "PONG ".$1."\r\n";
}
}
print "Server connection terminated!\n";
sub cmd_parsecmd(){
my $sender = shift;
my $cmd = shift;
my $args = shift;
$cmd = uc($cmd);
print $con "PRIVMSG $chan :Parsing...\r\n";
my @args = split(/[\s ,]+/,"$2");
if(undef($bot{'users'}{$sender}{'admin'})){
$bot{'users'}{$1}{'admin'} = 0;
}
if (defined($bot{'commands'}{$cmd})) {
if($bot{'users'}{$1}{'admin'} >= $bot{'commands'}{$cmd}[1]){
&remove_null($cmd, @args);
}else{
print $con "PRIVMSG $chan :arbot Not high enough level for $1 to run command $cmd.\r\n";
}
}
else {print $con "PRIVMSG $chan :arbot Unknown command '$cmd'\r\n"; }
}
sub say(){
my $msg = shift;
print $con "PRIVMSG $chan :arbot $msg\r\n";
}
sub remove_null(){
my $cmd = shift;
my $sender = shift;
my $null = shift;
my @args = @_;
&{$bot{'commands'}{$cmd}[0]}($sender, @args);
}
sub cmd_botop(){
my $sender = shift;
my $user = lc(shift);
$bot{'users'}{$user}{'admin'} = 3;
print $con "PRIVMSG $chan :arbot Bot Operator -> $user\r\n";
}
sub cmd_botdeop(){
my $sender = shift;
my $user = lc(shift);
$bot{'users'}{$user}{'admin'} = 0;
print $con "PRIVMSG $chan :arbot $user is no longer Bot Operator\r\n";
}
sub cmd_quit(){
my $sender = shift;
my $channel = shift;
if($channel =~ /#/){return;}
print $con "PART #$channel\r\n";
}
sub cmd_join(){
my $sender = shift;
my $channel = shift;
if($channel =~ /#/){return;}
print $con "JOIN #$channel\r\n";
}
sub cmd_silent(){
my $sender = shift;
}
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.