mIRC Home    About    Download    Register    News    Help

Print Thread
#95600 25/08/04 09:33 PM
Joined: Nov 2003
Posts: 257
A
Fjord artisan
OP Offline
Fjord artisan
A
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

#95601 25/08/04 10:00 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
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.

#95602 25/08/04 10:23 PM
Joined: Nov 2003
Posts: 257
A
Fjord artisan
OP Offline
Fjord artisan
A
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?

#95603 25/08/04 10:24 PM
Joined: Nov 2003
Posts: 257
A
Fjord artisan
OP Offline
Fjord artisan
A
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 )
}
}

#95604 25/08/04 10:25 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
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.

#95605 25/08/04 10:29 PM
Joined: Nov 2003
Posts: 257
A
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Nov 2003
Posts: 257
Thanks!

#95606 26/08/04 12:28 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
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.

#95607 26/08/04 01:53 AM
Joined: Nov 2003
Posts: 257
A
Fjord artisan
OP Offline
Fjord artisan
A
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 smile


Link Copied to Clipboard