mIRC Home    About    Download    Register    News    Help

Print Thread
#240879 04/03/13 04:45 AM
Joined: Mar 2013
Posts: 4
V
Self-satisified door
OP Offline
Self-satisified door
V
Joined: Mar 2013
Posts: 4
Hi im making a bot for my twitch.tv stream and i will be doing giveaways but i need a command like !giveaway and i want it to pick a random name from the channel eg if theres venomeater, nyarlathotp and lagmaster i want it to randomly pick one and output to something like
[Giveaway]: <chosenname> Just won the giveaway well send you a message with details on how to obtain.
also i want it to only be used by channel operators which for twitch.tv is a mod but in the mirc it adds the @ in front of name and does have the +o flag for the channel mods so i want the !giveaway command only accesable by operators of channel and if they arent channel operator would it be able to say [CMD]: Dear $nick , You do not have permission to use this command!

Thanks in advance

Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
It's pretty similar to your other post wink
Check if $nick isop, then use $rand() and $nick(#,0)

Code:
on *:text:!giveaway:#:{
  if ($nick isop #) { [Giveaway]: $nick(#,$rand(1,$nick(#,0))) Just won the giveaway, we'll send you a message with details on how to obtain. }
  else { [CMD]: Dear $nick , You do not have permission to use this command! }
}

Deega #240897 04/03/13 11:25 PM
Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
Err... sorry, I forgot the /msg commands laugh

Code:
on *:text:!giveaway:#:{
  if ($nick isop #) { msg # [Giveaway]: $nick(#,$rand(1,$nick(#,0))) Just won the giveaway, we'll send you a message with details on how to obtain. }
  else { msg # [CMD]: Dear $nick , You do not have permission to use this command! }
}

Deega #243296 04/11/13 06:51 PM
Joined: Nov 2013
Posts: 21
A
Ameglian cow
Offline
Ameglian cow
A
Joined: Nov 2013
Posts: 21
would there be any way of making it so that only followers can win, or so that it says afterwards in the message if they r following or not??

Joined: Aug 2013
Posts: 15
P
Pikka bird
Offline
Pikka bird
P
Joined: Aug 2013
Posts: 15
then you would have to make like a command that makes connection to the twitch api and reads all the follower names and saves them in an ini/text file.
and make it so the giveaway command checks if the name is on the list

Joined: Nov 2013
Posts: 21
A
Ameglian cow
Offline
Ameglian cow
A
Joined: Nov 2013
Posts: 21
i do not understand how i would go about doing that as i am still very new to coding


Link Copied to Clipboard