mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2015
Posts: 16
L
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2015
Posts: 16
I am a bit stuck on a little script I am trying to get working, I've taken the best parts of two different scripts I run and I am trying to amalgamate them into something much better here is what I have so far...

on *:TEXT:*!Duel*:#: {
if ((%floodduel) || ($($+(%,floodduel.,$nick),2))) { return }
set -u10 %floodduel On
set -u30 %floodduel. $+ $nick On
msg $chan  $nick has Challaneged $2- to a duel!
.timereight 1 2 msg $chan /me $2- has Accepted $nick $+ 's Challenge

--(im not sure what to put in here, I have tried another timer but nothing happens)--

if ($nick isop #) {
var %randmods = $rand(1,2)
if (%randmods == 1) msg $chan $nick scoops $2- $+ 's eyes out with a rusty spoon and feeds them to a crow! $nick is Victorius.
if (%randmods == 2) msg $chan $nick pulls $2- $+ 's underware over their head and runs them up a near by flag poll, $nick is the clear winner!
}
else {
var %randnumber = $rand(1,2)
if (%randnumber == 1) { msg $chan $nick slips on a banana peel and $2- gets the upperhand with a Clobber stomp to the nether region. $2- Wins!
if (%randnumber == 2) { msg $chan $2- tries to duck and weave as $nick thorws a flurry of punches, $2- fails badly, $nick is the winner!
}

The first section works lovely, but I am guessing because I am using a timer it is cancelling out the last portion.
When I have run this command I get the error message " * /msg: insufficient parameters"

I am hoping someone knows a way around this, or has another solution to what I am trying to accomplish.
I'm still fairly new at this, but I am having a lot of fun making my own Twitch Bot.

Thank you for any suggestions or help you send my way ^_^

Last edited by logan_671; 04/05/15 07:54 AM.
Joined: Feb 2015
Posts: 16
L
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2015
Posts: 16
EDIT:

Okay i solved one problem, so now the problem is slightly different now


on *:TEXT:*!Duel*:#: {
if ((%floodduel) || ($($+(%,floodduel.,$nick),2))) { return }
set -u10 %floodduel On
set -u30 %floodduel. $+ $nick On
msg $chan  $nick has Challaneged $2- to a duel!
.timereight 1 2 msg $chan /me $2- has accepted challenge from $nick $+ .

---(the main problem is still here I think)---


if ($nick isop #) {
var %randmods = $rand(1,2)
if (%randmods == 1) msg $chan $nick scoops $2- $+ 's eyes out with a rusty spoon and feeds them to a crow! $nick is Victorius.
if (%randmods == 2) msg $chan $nick pulls $2- $+ 's underware over their head and runs them up a near by flag poll, $nick is the clear winner!
}
else {
var %randnumber = $rand(1,2)
if (%randnumber == 1) { msg $chan $nick slips on a banana peel and $2- gets the upperhand with a Clobber stomp to the nether region. $2- Wins!
if (%randnumber == 2) { msg $chan $2- tries to duck and weave as $nick throws a flurry of punches, $2- fails badly, $nick is the winner!
}

I had a conflict of codes before but now I'm heading on the right track sort of, what happens now as follows

I type in !duel Steve

Botresponce => Logan has challenged steve to a duel (this works yay)
Botresponce => logan scoops steve's eyes out etc etc (this is not supposed to happen yet)
Botresponce => steve has accepted challenge from logan (this should be up a line)

I know the timer has something to do with it, but i'd love to have this working with the timer still in there.

Last edited by logan_671; 04/05/15 08:20 AM.
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
You delay this line ".timereight 1 2 msg $chan /me $2- has accepted challenge from $nick $+ .", but you post the others without a delay. If you remove the timer and test it, does it look like you want then? And also, no need for $2- , $2 will return the nick.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Feb 2015
Posts: 16
L
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2015
Posts: 16
Taking the timer out did fix the order, but I would like to have the delay in there so it doesn't spam 3 messages all at once.

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Use more then one timer?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Feb 2015
Posts: 16
L
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2015
Posts: 16
I've tried moving the timers around it just comes back with insufficient parameters I'm not really sure how I can get it to work.

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
This is untested.
Code:
on *:TEXT:*!Duel*:#: {
  if ((%floodduel) || ($($+(%,floodduel.,$nick),2))) { return }
  set -u10 %floodduel On
  set -u30 %floodduel. $+ $nick On
  msg $chan  $nick has Challaneged $2 to a duel!
  .timereight 1 1 describe $chan $2 has accepted challenge from $nick $+ .

  if ($nick isop #) {
    var %randmods = $rand(1,2)
    if (%randmods == 1) { .timereight 1 2 msg $chan $nick scoops $2 $+ 's eyes out with a rusty spoon and feeds them to a crow! $nick is Victorius. }
    if (%randmods == 2) { .timereight 1 3 msg $chan $nick pulls $2 $+ 's underware over their head and runs them up a near by flag poll, $nick is the clear winner! }
  }
  else {
    var %randnumber = $rand(1,2)
    if (%randnumber == 1) { .timereight 1 2 msg $chan $nick slips on a banana peel and $2 gets the upperhand with a Clobber stomp to the nether region. $2 Wins! }
    if (%randnumber == 2) { .timereight 1 3 msg $chan $2 tries to duck and weave as $nick throws a flurry of punches, $2 fails badly, $nick is the winner! }
  }
}


And if you post code, use the [ code ] [/ code ] tags, remove the space i them and use Preview Post to see how it looks like.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Feb 2015
Posts: 16
L
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2015
Posts: 16
Special thanks goes out to Sparta!!!

Code:

on *:TEXT:*!Duel*:#: {  
  if ((%floodduel) || ($($+(%,floodduel.,$nick),2))) { return }
  set -u10 %floodduel On
  set -u10 %floodduel. $+ $nick On
  .timereight 1 2 msg $chan  $nick has Challaneged $2 to a duel!
  .timernine 1 4 msg $chan /me $2 has accepted challenge from $nick $+ .
  if ($nick isop #logan_671) {
    var %randmods = $rand(1,2)
    if (%randmods == 1) { .timerten 1 6 msg $chan $nick scoops $2 $+ 's eyes out with a rusty spoon and feeds them to a crow! $nick is Victorius. }
    if (%randmods == 2) { .timerten 1 6 msg $chan $nick pulls $2 $+ 's underware over their head and runs them up a near by flag poll, $nick is the clear winner! }
  }
  else {
    var %randnumber = $rand(1,2)
    if (%randnumber == 1) { .timerten 1 6 msg $chan $nick slips on a banana peel and $2 gets the upperhand with a Clobber stomp to the nether region. $2 Wins! }
    if (%randnumber == 2) { .timerten 1 6 msg $chan $2 tries to duck and weave as $nick throws a flurry of punches, $2 fails badly, $nick is the winner! }
  }
}



I really appreciate the help, I tested what you come up with, It kind of worked, it was so close but lost the "accepted challenge line), so I played around a bit more and found when I gave each section a different timer name eg timer1, timer2, timer3, all segments worked perfectly!

Thank you very much for the help!

(I know why you changed /me to Describe but for some reason it doesn't work)

Last edited by logan_671; 04/05/15 09:47 AM.
Joined: May 2015
Posts: 11
S
Pikka bird
Offline
Pikka bird
S
Joined: May 2015
Posts: 11
Just more of a use question but I didn't see anything in the script for the opponent to accept


Link Copied to Clipboard