mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2016
Posts: 22
W
wobY Offline OP
Ameglian cow
OP Offline
Ameglian cow
W
Joined: Oct 2016
Posts: 22
So I'm making a giveaway bot and I implemented the sub luck option. But now I don't know how could the bot write the users name in the text file X times.

Would this work?
Code:
timer %subluck 1 write Giveaway.txt $nick

Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
I'm not completely clear of what you are asking, but you shouldn't use a timer IMO. There is no reason to tell mIRC to wait to keep using the WRITE function. A WHILE loop would work better.

Code:
ON $*:TEXT:/^!subluck\s\d+/iS:#: {
  subluck $2
}

alias subluck {
  VAR %x = $1
  VAR %y = 1
  WHILE (%x >= %y) {
    WRITE Giveaway.txt $nick
    INC %y
  }
}


The above should give you a basic idea of how to implement it. In the above example, if a user types "!subluck 5" then it will write their name to Giveaway.txt five times.

Joined: Oct 2016
Posts: 22
W
wobY Offline OP
Ameglian cow
OP Offline
Ameglian cow
W
Joined: Oct 2016
Posts: 22
tnx laugh


Link Copied to Clipboard