mIRC Homepage
Posted By: Xtibian Little Help - 21/09/06 02:35 AM
Well, isnt a script around that does what I want so Ill ask if you guys/gals can help me.

I'm trying to get a script(I cant make it not a clue how lol frown)to calculate any set xp that a monster gives when its killed and to have that multiplied by a number between 1 - 200. So if some one does !command <number> <monster> it returns like: $nick $+ , <number> <monster> is <the calculated amount>. Also, If you give me a basic on how to I may be able to do it myself. But, has to support more then one monster so I think you have to use regex(I have no real clue on how to work with that sorry frown). :| Anyways, if you have any questions what so ever ask me.

Thanks
Posted By: RusselB Re: Little Help - 21/09/06 03:54 AM
How is the number between 1 and 200 arrived at for the multiplier? Is there a process involved, or is it random?
Posted By: Scorpwanna Re: Little Help - 21/09/06 04:27 AM
/me scratches head. huh?
Posted By: MikeChat Re: Little Help - 21/09/06 05:42 AM
trying to decypher your request

to calculate any set xp that a monster gives when its killed and to have that multiplied by a number between 1 - 200. So if some one does !command <number> <monster> it returns like: $nick $+ , <number> <monster> is <the calculated amount>.

in channel you would post to the bot
!killpoint (a number in range 1 - 200)
fex:
!killpoint 150 monster1

Code:
on *:text:!killpoint*:#:{
  echo -a $1
  if ($2 isnum 1-200) {
    if ($3 == monster1) { msg $chan $nick $2 times $3 is $calc($2 * 100) }
    elseif ($3 == monster2) { msg $chan $nick $2 times $3 is $calc($2 * 500) }
  }
  else { msg $chan number $qt($2) out of range (1-200) }
}


this version this randomly chooses a number to multiply with

!killpoint monster1

Code:
on *:text:!killpoint*:#:{
  var %mult = $r(1,200)
  if ($1 == monster1) { msg $chan $nick %mult $1 $calc( %mult * 100) }
  if ($1 == monster2) { msg $chan $nick %mult $1 $calc( %mult * 500) }
}
else { msg $chan $qt($1) is not known to me. }
}

© mIRC Discussion Forums