mIRC Homepage

simple text script

Posted By: NeUtRoN_StaR

simple text script - 09/12/05 12:08 AM

ok,
i took a request to write a script and i dont know why its giving me so much trouble but it is

the idea is that someone says brb and the script replies hurry back $nick
and the next thing they say triggers a welcome back $nick

the way i approached this; well one of them
was to have
Code:
on @*:text:*:#:{
  if ((% $+ $nick != on) && (*brb* iswm $$1-)) {
    set -s % $+ $nick on
    msg $chan Hurry back $nick
  }
  elseif (% $+ $nick == on) {
    msg $chan Welcome back $nick
    unset -s % $+ $nick  
  }
}

Posted By: FiberOPtics

Re: simple text script - 09/12/05 12:23 AM

Try the following line of code, and see what exactly goes different than what you expect it to do.

//set -s % $+ $me on | echo -a % $+ $me

It will have echo'd: %<yournick>.

Since you want to check the value of %<yournick>, this isn't correct, which leads to the solution of your problem:

//echo -a $(% $+ $me,2)
//echo -a $($+(%,$me),2)
//echo -a % [ $+ [ $me ] ]

Try to figure out why exactly you need to do the three above solutions, typing /help $eval and /help [ ] evaluation brackets, will help you understand.
Posted By: NeUtRoN_StaR

Re: simple text script - 09/12/05 12:29 AM

i think i tried using forced evaluation with $()
around any instance of % $+ $nick
i dont recall it working but ill take another crack at it
thanks fiber
edit duh need to evaluate it twice
thanks again
Posted By: NeUtRoN_StaR

Re: simple text script - 09/12/05 12:39 AM

k it works now again
i like how u put the teaching angle on it rather than just feeding me the code

thanks once again
© 2019 mIRC Discussion Forums