mIRC Home    About    Download    Register    News    Help

Print Thread
#27309 31/05/03 07:05 PM
A
a_th3ory
a_th3ory
A
I have a problem with this script I just created
Code:
 on *:TEXT:You busted Rick 999 out!:#:{
  if (%DF.options == on) && ($nick != $me) { goto busts }
  :busts
  if (%busts. [ $gettok(1,1,33) ] != $null) { inc %busts. [ $gettok(1,1,33) ] 1 | goto tbusts }
  if (%busts. [ $gettok(1,1,33) ] == $null) { set %busts. [ $gettok(1,1,33) ] 1 | goto tbusts }
  :tbusts
  if (%busts != $null) { inc %busts 1 | goto end }
  if (%busts == $null) { set %busts 1 | goto end }
  :end
/msg $chan Hey, ThanX $nick $+ , you've busted me out %busts. [ $gettok(1,1,33) ] out of %busts total times! }
 

It's supposed to Say "[19:54:12] [+Rick999[Away]] Hey, ThanX Demo_unit, you've busted me out 3 out of 6 total times!"

but instead it says

"[19:54:12] [+Rick999[Away]] Hey, ThanX Demo_unit, you've busted me out 3 1 out of 6 total times!"

Can someone help me with this?

#27310 31/05/03 07:33 PM
P
pheonix
pheonix
P
$gettok(1,1,33) will return 1
$gettok(tokshere,numberhere,ascofseperatorhere)

#27311 31/05/03 09:20 PM
S
ScatMan
ScatMan
S
u really need to say what are u trying to do with this code, but i can see u're using it wrong

#27312 31/05/03 09:53 PM
Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
you may try where u attach a value to a variabler name use:

[ $+ [ value> ] ]

instead of [ <value> ]

Case in point:

Quote:

if (%busts. [ $gettok(1,1,33) ] != $null) { inc %busts. [ $gettok(1,1,33) ] 1 | goto tbusts }

#27313 31/05/03 09:57 PM
S
ScatMan
ScatMan
S
heh, well, $gettok(1,1,33) is the same as 1 so i guess it doesn't what he wanted to do

#27314 31/05/03 10:04 PM
Joined: Dec 2002
Posts: 698
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 698
It's a bit hard to work out what exactly you're trying to do there, but maybe this is what you want. It will count the number of times each nick has said that phrase, plus the total times it was said.
Code:
on *:TEXT:You busted Rick 999 out!:#:{
  if (%DF.options != on) { return }
  inc %busts. $+ $nick
  inc %busts
  msg $chan Hey, ThanX $nick $+ , you've busted me out %busts. [ $+ [ $nick ] ] out of %busts total times!
}

#27315 01/06/03 12:19 PM
A
a_th3ory
a_th3ory
A
Thanks y'all, it works now


Link Copied to Clipboard