mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2015
Posts: 3
B
B3J Offline OP
Self-satisified door
OP Offline
Self-satisified door
B
Joined: Aug 2015
Posts: 3
At the moment I'm trying to create a "Pass The Bomb" game, here's my code so far :

Code:
on *:TEXT:!bomb:#: {
 if ((%floodBOMB) || ($($+(%,floodBOMB.,$nick),2))) { return }
  set -u20 %floodBOMB On
  set -u20 %floodBOMB. $+ $nick On
  write -c terrorist.txt 
  msg $chan $nick has the bomb. The bomb will detonate in 15 seconds! Use !pass <user> to throw the bomb "at" the next person!
  write terrorist.txt $nick $+
  
} 
  
on *:TEXT:!pass *:#:{  
  if ($nick == $read(terrorist.txt, n, 0 || 1)) {
  write -c terrorist.txt
  write -il1 terrorist.txt $2- $+ 
  msg $chan $nick has passed the bomb to $2-
  
  }
  }  



I need help creating a timer so that after 15 seconds it'll say
Code:
msg $chan The bomb exploded, killing $read(terrorist.txt, n, 1)

Joined: May 2015
Posts: 133
K
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
You can add this:

Code:
.timerbomb 1 15 msg $chan The bomb exploded, killing $read(terrorist.txt, n, 1)


twitter @keyeslol
Joined: Aug 2015
Posts: 3
B
B3J Offline OP
Self-satisified door
OP Offline
Self-satisified door
B
Joined: Aug 2015
Posts: 3
I used this but it says the person who does !bomb died and not the person with the bomb: for instance

Code:
test_1: !bomb
test_1: !pass test_2
The_bot: the bomb has been passed to test_2

test_2: !pass test_3
The_bot: the bomb has been passed to test_3

test_3: !pass michael_jackson
The_bot: the bomb has been passed to test_4

michael_jackson: !pass jimmy_kidz
The_bot: the bomb has been passed to jimmy_kidz

The_Bot: The bomb exploded, killing test_1

Last edited by B3J; 26/08/15 05:57 PM.
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Make sure to update the $read dynamically.
The way it's set right now is to use the value from when the timer started, not ended.

Fix: $!read(terrorist.txt)
Note, /write -c will clear the text file AND add anything after it. No need to do /write twice =)


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Link Copied to Clipboard