mIRC Homepage
Posted By: a_th3ory Error with a Variable - 31/05/03 07:05 PM
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?
Posted By: pheonix Re: Error with a Variable - 31/05/03 07:33 PM
$gettok(1,1,33) will return 1
$gettok(tokshere,numberhere,ascofseperatorhere)
Posted By: ScatMan Re: Error with a Variable - 31/05/03 09:20 PM
u really need to say what are u trying to do with this code, but i can see u're using it wrong
Posted By: KingTomato Re: Error with a Variable - 31/05/03 09:53 PM
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 }
Posted By: ScatMan Re: Error with a Variable - 31/05/03 09:57 PM
heh, well, $gettok(1,1,33) is the same as 1 so i guess it doesn't what he wanted to do
Posted By: Nimue Re: Error with a Variable - 31/05/03 10:04 PM
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!
}
Posted By: a_th3ory Re: Error with a Variable - 01/06/03 12:19 PM
Thanks y'all, it works now
© mIRC Discussion Forums