|
Joined: Nov 2003
Posts: 257
Fjord artisan
|
OP
Fjord artisan
Joined: Nov 2003
Posts: 257 |
on *:sockread:bot:{ sockread %a window -ek @probe echo @probe $lower($remove($gettok(%a,1,32),:)) $+ ¬ $+ $lower($remove($gettok(%a,4-,32),:)) set %nick $mid(%a,2,$calc($pos(%a,!,1) - 2)) if ($gettok(%a,1,32) == PING) { sockwrite -n $sockname pong $gettok(%a,2,32) } if (($2 == KICK) && ($4 == %bot.nick)) { sockwrite -n $sockname JOIN $3 } }
I'm trying to get my bot to rejoin when it's kicked
|
|
|
|
Joined: Dec 2002
Posts: 788
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 788 |
Your using $2 not $gettok(%a,2,32), same for $4/$3.
You have two choices, either use $gettok(), or use,
sockread %a tokenize 32 %a
This will allow you to refer to everything as $1/$2/ect instead of having to $gettok(string,N,32).
Eamonn.
|
|
|
|
Joined: Nov 2003
Posts: 257
Fjord artisan
|
OP
Fjord artisan
Joined: Nov 2003
Posts: 257 |
i tried fixing it and i think i made it even worse....can u replace the kick event with something else?
|
|
|
|
Joined: Nov 2003
Posts: 257
Fjord artisan
|
OP
Fjord artisan
Joined: Nov 2003
Posts: 257 |
ahh, is this what u meant?
on *:sockread:bot:{ sockread %a tokenize 32 %a window -ek @probe echo @probe tokenize 32 %a set %nick $mid(%a,2,$calc($pos(%a,!,1) - 2)) if ($1 == PING) { sockwrite -tn * pong $gettok(%a,2,32) } if ($2 == KICK) { sockwrite -tn * join $3 ) } }
|
|
|
|
Joined: Dec 2002
Posts: 788
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 788 |
on *:sockread:bot:{ sockread %a tokenize 32 %a window -ek @probe echo @probe $lower($remove($1,:)) $+ ¬ $+ $lower($remove($4-,:)) set %nick $mid(%a,2,$calc($pos(%a,!,1) - 2)) if ($1 == PING) { sockwrite -n $sockname pong 2 } if (($2 == KICK) && ($4 == %bot.nick)) { sockwrite -n $sockname JOIN $3 } }
try that.
Eamonn.
|
|
|
|
Joined: Nov 2003
Posts: 257
Fjord artisan
|
OP
Fjord artisan
Joined: Nov 2003
Posts: 257 |
|
|
|
|
Joined: Dec 2002
Posts: 788
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 788 |
Sorry, just reading your post i noticed a typo, shouldnt really affect the script, but just to be safe.
if ($1 == PING) { sockwrite -n $sockname pong [color:red]2 } [/color] Should be,
if ($1 == PING) { sockwrite -n $sockname pong [color:red]$2 } [/color] Also, judging from;
set %nick $mid(%a,2,$calc($pos(%a,!,1) - 2))
Your trying to get a nickname, from nickname!identd@host, even though your not using it.. This can be done very simply.
$gettok(nickname!identd@host,1,33)
Eamonn.
|
|
|
|
Joined: Nov 2003
Posts: 257
Fjord artisan
|
OP
Fjord artisan
Joined: Nov 2003
Posts: 257 |
i noticed that before you mentioned it but thank you again for your help. I'll probably need more , look for some more posts later on
|
|
|
|
|