mIRC Home    About    Download    Register    News    Help

Print Thread
#27309 31/05/03 07:05 PM
Joined: Apr 2003
Posts: 9
A
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Apr 2003
Posts: 9
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
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
$gettok(1,1,33) will return 1
$gettok(tokshere,numberhere,ascofseperatorhere)


new username: tidy_trax
#27311 31/05/03 09:20 PM
Joined: May 2003
Posts: 730
S
Hoopy frood
Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
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: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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 }


-KingTomato
#27313 31/05/03 09:57 PM
Joined: May 2003
Posts: 730
S
Hoopy frood
Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
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: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
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
Joined: Apr 2003
Posts: 9
A
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Apr 2003
Posts: 9
Thanks y'all, it works now


Link Copied to Clipboard