mIRC Home    About    Download    Register    News    Help

Print Thread
#242613 10/08/13 03:41 PM
Joined: Aug 2013
Posts: 22
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2013
Posts: 22
I don't even know where to start this Code. because i been looking around everywhere to give me some type of tip... but do anyone know how to make a code that Cycle through Sentences on a timer... like every 10 minutes a bot shoot out a different one. and if we have 4 of them. it repeats after the fourth one. ect ect for an infinite loop till you you up a stop timer on it

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Code:
alias cycle.start {
  var %chan = $1
  timercycle.send 0 600 cycle.send %chan
}

alias cycle.stop {
  timercycle.send off
}

alias cycle.send {
  var %chan = $1, %file = sentences.txt, %lines = $lines(%file)
  set %cycle.line $calc(%cycle.line % %lines + 1)
  msg %chan $read(%file,n,%cycle.line)
}

Joined: Aug 2013
Posts: 22
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2013
Posts: 22
thanks this means a lot smile.. but got a questions Im still kinda new to this MIRC scripting . can you kinda tell me what the script exactly do. because when I try to put it in .. its not working smirk

Joined: Aug 2013
Posts: 22
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2013
Posts: 22
Code:
alias cycle.start {
  var %chan = $1
  timercycle.send 0 20 cycle.send %chan
}

alias cycle.stop {
  timercycle.send off
}

alias cycle.send {
  var %chan = $1, %file = C:\Users\Flareon\AppData\Roaming\mIRC\sentences.txt, %lines = $lines(%file)
  set %cycle.line $calc(%cycle.line % %lines + 1)
  msg %chan $read(%file,n,%cycle.line)
}

on *:TEXT:!timers on:#achievementsjunkie: {
  if ($nick isop #) {
    msg $chan Link cycle is now starting.
    cycle.start
  }
}

on *:TEXT:!timers off:#achievementsJunkie: {
  if ($nick isop #) {
    msg $chan Link cycle is now stopping.
    cycle.stop
  }
}


that the code that I end up with... I don't know if I completely mess it up or not .

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
You need to call cycle.start with the channel name, in your text event it should be: cycle.start $chan

And you don't need to specify the full path for the file, mIRC will treat it relative to that folder on its own

Joined: Aug 2013
Posts: 22
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2013
Posts: 22
thanks so much work like a charm!


Link Copied to Clipboard