mIRC Homepage
Posted By: Dcease Need help to fix roulette script - 24/07/14 12:31 AM
So basically I made a roulette script sort off. And I made few of the randnumber to not timeout the player but apparently it times out even with no timeout

on *:TEXT:!Roulette:#: {
if ((%floodroulette) || ($($+(%,floodroulette.,$nick),2))) { return }
set -u60 %floodroulette On
set -u120 %floodroulette. $+ $nick On
if ($nick isop #) {
var %randmods = $rand(1,2)
if (%randmods == 1) msg $chan The gun jambs up! Do you have special powers, $nick ?
if (%randmods == 2) msg $chan BANG! ... The bullet was deflected off your mod armor, and killed a random viewer, but you live! There must be secret powers in your mod armor $nick
}
else {
var %randnumber = $rand(1,4)
if (%randnumber == 1) { msg $chan $nick tries to pull the trigger... but is too afraid and drops the gun, apparently the gun triggers itself and shoot $nick in the dick... Kreygasm
msg $chan /timeout $nick 120 }
msg $chan /timeout $nick 120 }
if (%randnumber == 2) msg $chan Roulette clicks!...Empty...You live to see another day $nick
if (%randnumber == 3) { msg $chan Click!... Nothing happened but... $nick got so scared that $nick shit in his/her pants and died.
msg $chan /timeout $nick 120 }
if (%randnumber == 4){ msg $chan $nick starts to shake, $nick tries to pull the trigger but can't. $nick drops the gun, $nick isn't up for the challenge Roulette..
}
Posted By: Loki12583 Re: Need help to fix roulette script - 24/07/14 01:24 AM
Your spaces and braces are all messed up. Use the mIRC editor and you'll see that things don't align properly.

This is the correct way to use multiline if blocks:

Code:
if (%randnumber == 1) {
  cmd
  cmd
}
elseif (%randnumber == 2) {
  cmd
  cmd
}
else {
  cmd
}


Please surround your code with [code][ /code] to place it into a code block (remove the space).
Posted By: Dcease Re: Need help to fix roulette script - 24/07/14 02:19 AM
I seem to not being able to make it work, and it fucked up all my scripts. Except for the just on *:TEXT:*!
Posted By: Majeye Re: Need help to fix roulette script - 24/07/14 02:49 AM
So basically you copied the roulette script I had posted and merely deleted the 'timeout' portion of the script? and now can't get it to work and are asking for help saying its your original work?

newsflash for you.. it wasn't even my original work.

so you stole a script that was stolen. lol

just a heads up before you claim things as your own.

Code:
On *:TEXT:!Roulette:#: {
  if ((%floodroulette) || ($($+(%,floodroulette.,$nick),2))) { return }
  set -u60 %floodroulette On
  set -u180 %floodroulette. $+ $nick On
  if ($nick isop #) {
    var %randmods = $rand(1,4)
    if (%randmods == 1) msg $chan The gun jambs up! Do you have special powers, $nick ?
    if (%randmods == 2) msg $chan BANG! ... The bullet was deflected off your mod armor, and killed a random viewer, but you live! There must be secret powers in your mod armor $nick
    if (%randmods == 3) msg $chan BANG! ... The bullet missed, you only have your born moderation powers to thank $nick
    if (%randmods == 4) msg $chan $nick dodges bullets better than Neo, it must be the mod armor.
  }
  else {
    var %randnumber = $rand(1,4)
    if (%randnumber == 1) { msg $chan BANG!... Roulette claims another soul. R.I.P $nick }
    if (%randnumber == 2) { msg $chan Roulette clicks!...Empty...You live to see another day $nick }
    if (%randnumber == 3) { msg $chan BANG!... $nick Was caught trying to steal from TheBlueMuzzy's Karma coffers. }
    if (%randnumber == 4) { msg $chan $nick starts to shake, $nick tries to pull the trigger but can't. $nick drops the gun, $nick isn't up to the challenge of Roulette. }
  }
}


Just threw that together for you quick.. you may want to check brackets.
Posted By: Dcease Re: Need help to fix roulette script - 24/07/14 07:23 AM
That's what I had from the beginning, but dont I have to do

{
CMD
CMD
}
Posted By: Dcease Re: Need help to fix roulette script - 24/07/14 08:45 AM
Originally Posted By: Majeye
So basically you copied the roulette script I had posted and merely deleted the 'timeout' portion of the script? and now can't get it to work and are asking for help saying its your original work?

newsflash for you.. it wasn't even my original work.

so you stole a script that was stolen. lol

just a heads up before you claim things as your own.

Code:
On *:TEXT:!Roulette:#: {
  if ((%floodroulette) || ($($+(%,floodroulette.,$nick),2))) { return }
  set -u60 %floodroulette On
  set -u180 %floodroulette. $+ $nick On
  if ($nick isop #) {
    var %randmods = $rand(1,4)
    if (%randmods == 1) msg $chan The gun jambs up! Do you have special powers, $nick ?
    if (%randmods == 2) msg $chan BANG! ... The bullet was deflected off your mod armor, and killed a random viewer, but you live! There must be secret powers in your mod armor $nick
    if (%randmods == 3) msg $chan BANG! ... The bullet missed, you only have your born moderation powers to thank $nick
    if (%randmods == 4) msg $chan $nick dodges bullets better than Neo, it must be the mod armor.
  }
  else {
    var %randnumber = $rand(1,4)
    if (%randnumber == 1) { msg $chan BANG!... Roulette claims another soul. R.I.P $nick }
    if (%randnumber == 2) { msg $chan Roulette clicks!...Empty...You live to see another day $nick }
    if (%randnumber == 3) { msg $chan BANG!... $nick Was caught trying to steal from TheBlueMuzzy's Karma coffers. }
    if (%randnumber == 4) { msg $chan $nick starts to shake, $nick tries to pull the trigger but can't. $nick drops the gun, $nick isn't up to the challenge of Roulette. }
  }
}


Just threw that together for you quick.. you may want to check brackets.

That script right there, there's no timeout? I tried to add something like $chan /timeout $nick 120 but it wont work.
Posted By: Dcease Re: Need help to fix roulette script - 24/07/14 08:51 AM
i didnt claim it was "MINE" nor is there any credits anywhere. Altho I make cooldown 1 and 1 to test the script without having to wait obviously... And I once made it work for both mods and non mods, now the script you sent only work for mods/ the script I sent. When I had the working roulette script, it would give both the mod message and a normal viewer message. Which was kinda odd.
Posted By: AeonPsych Re: Need help to fix roulette script - 25/07/14 01:11 AM
the if statements are bad, or the brackets are bad, or both
Posted By: blessing Re: Need help to fix roulette script - 25/07/14 06:53 AM
Braces are messed up.
Here is the correction.
Code:
on *:TEXT:!Roulette:#: {
  if ((%floodroulette) || ($($+(%,floodroulette.,$nick),2))) { return }
  set -u60 %floodroulette On
  set -u120 %floodroulette. $+ $nick On
  if ($nick isop #) {
    var %randmods = $rand(1,2)
    if (%randmods == 1) {
      msg $chan The gun jambs up! Do you have special powers, $nick ?
    }
    if (%randmods == 2) {
      msg $chan BANG! ... The bullet was deflected off your mod armor, and killed a random viewer, but you live! There must be secret powers in your mod armor $nick
    }
  }
  else {
    var %randnumber = $rand(1,4)
    if (%randnumber == 1) { 
      msg $chan $nick tries to pull the trigger... but is too afraid and drops the gun, apparently the gun triggers itself and shoot $nick in the dick... Kreygasm
      msg $chan /timeout $nick 120 
    }
    if (%randnumber == 2) { 
      msg $chan Roulette clicks!...Empty...You live to see another day $nick
    }
    if (%randnumber == 3) { 
      msg $chan Click!... Nothing happened but... $nick got so scared that $nick shit in his/her pants and died.
      msg $chan /timeout $nick 120 
    }
    if (%randnumber == 4) {
      msg $chan $nick starts to shake, $nick tries to pull the trigger but can't. $nick drops the gun, $nick isn't up for the challenge Roulette..
    }
  }
}
© mIRC Discussion Forums