mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2006
Posts: 1
I
Mostly harmless
OP Offline
Mostly harmless
I
Joined: Jun 2006
Posts: 1
Well, I got a script. And I want it to subtract from a total of 2000. But the numbers subtracted can only be from 1 - 100.

Then I got a script I need to fix. It's suppost to say Choose your opponet, then wait, then after the one person says a nick on the chan list, it says $nick shoosen to battle $nick or sumthin.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
1)
Code:
 on *:text:!subtract*:#:{
if $$2 < 1 || $$2 > 100 {
.msg $chan Sorry $nick The number must be between 1 and 100
}
else .msg $chan $calc(2000 - $$2)
}
 


Regarding your second code, it would probably be easier to fix what you have, rather than give something from scratch. Please post the code that you currently have. If the code has a lot more in it, than just this, then only post the relevant parts, and please remember to use the Code Tags

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Instead of if $$2 < 1 || $$2 > 100 you could also put if $$2 !isnum 1-100

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
on *:text:!subtract *:#:{
  if ($2 !isnum 1-100) { .msg $chan Sorry $nick The number must be between 1 and 100 }
  else { .msg $chan $calc(2000 - $2) }
}


Isnum is much nicer smile

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
oops..forgot about being able to specify a range when using isnum

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
oops schaefer31 beat me to it!


Link Copied to Clipboard