mIRC Homepage

need help with scripts

Posted By: demmy

need help with scripts - 25/06/04 06:11 PM

i am trying to make a script that does one of many things randomly but i cannot get it to function correctly any ideas how to fix it?
and can someone help me creat a script for quoting in a channel?
on *:action:*:huggles *:{
if ($me isin $2){
/var %randomnumber = $random()
if (%randomnumber < 0.5) {
/do $chan implodes
else {
/do $chan huggles back
}
Posted By: Venoman

Re: need help with scripts - 25/06/04 06:37 PM

um, yuck. haha. sorry your code's just a bit off, I'll tweak it for you:

Code:
on *:action:huggles *:#: { 
if ($2 isin $me) {
/var %randomnumber = $rand(1,2)
if (%randomnumber == 1) {
/describe $chan implodes
else {
/describe $chan huggles back
}


should work for you. I switched to ($2 isin $me) because I assume you want it to work if they use part of your nick. in my case something like "huggles veno" should respond. you can also just use ($me == $2) if you want it only to respond to your entire nick.

-Venoman
Posted By: ZibingsPrez

Re: need help with scripts - 25/06/04 07:02 PM

Hrm...you sure bout that tweak with "isin"? If they want it to do something when they use their nick, wouldn't make too much sense to look for the entire string inside the person's nick... Or maybe I read the manual wrong..
Posted By: Kelder

Re: need help with scripts - 25/06/04 10:56 PM

Code:
on *:action:huggles *:#: {
  if ($2 == $me) {
    if ($rand(0,1)) describe $chan implodes
    else describe $chan huggles back
  }
}


For the test i'd need more information on what you want; i could even be
if ($regex($2-,$+(\b,$me,\b)) to check if your nick is a word in it; works even if it's surrounded by .,:;=+ etc

for the $rand change: if (0) is false, also if ($false) and if ($null) are false, all other text returns true, so if (1) is true, if (moo) is true and so on smile

© 2021 mIRC Discussion Forums