mIRC Home    About    Download    Register    News    Help

Print Thread
#247096 21/07/14 02:39 AM
Joined: Jan 2014
Posts: 107
M
Majeye Offline OP
Vogon poet
OP Offline
Vogon poet
M
Joined: Jan 2014
Posts: 107
Ok, so I'm running roulette on my bot as well as a point system.. would it be possible to somehow add script to add/take points away?

Like someone gets shot, take X number of points from them.. and say I add a response where they turn the gun onto someone else and shoot them, and then the command adds X number of points?

Anyone know how to go about doing this? here is the roulette script:

*edit* -- I felt I should add my points system is called "Karma" and the ini file is karma.ini

Code:
On *:TEXT:!Roulette:#: {
  if ((%floodroulette) || ($($+(%,floodroulette.,$nick),2))) { return }
  set -u60 %floodroulette On
  set -u180 %floodroulette. $+ $nick On
  if ($nick isop #) {
    var %randmods = $rand(1,4)
    if (%randmods == 1) msg $chan The gun jambs up! Do you have special powers, $nick ?
    if (%randmods == 2) msg $chan BANG! ... The bullet was deflected off your mod armor, and killed a random viewer, but you live! There must be secret powers in your mod armor $nick
    if (%randmods == 3) msg $chan BANG! ... The bullet missed, you only have your born moderation powers to thank $nick
    if (%randmods == 4) msg $chan $nick dodges bullets better than Neo, it must be the mod armor.
  }
  else {
    var %randnumber = $rand(1,4)
    if (%randnumber == 1) { msg $chan BANG!... Roulette claims another soul. R.I.P $nick
    msg $chan /timeout $nick 15 }
    if (%randnumber == 2) { msg $chan Roulette clicks!...Empty...You live to see another day $nick }
    if (%randnumber == 3) { msg $chan BANG!... $nick Was caught trying to steal from TheBlueMuzzy's Karma coffers.
    msg $chan /timeout $nick 15 }
    if (%randnumber == 4) { msg $chan $nick starts to shake, $nick tries to pull the trigger but can't. $nick drops the gun, $nick isn't up to the challenge of Roulette. }

  }
}

Last edited by Majeye; 21/07/14 02:51 AM.
Joined: Jul 2014
Posts: 48
A
Ameglian cow
Offline
Ameglian cow
A
Joined: Jul 2014
Posts: 48
in the code for when the number is right to shoot, just add a reference to the add/remove points alias.

As for targeting 2 different viewers, you would have to have the code within roulette identify another user, or have the command pre-identify another user. I'm not sure how to identify another user, but I am sure it is possible, and fairly easy to do, just need to figure out the syntax for it.

Off the top of my head, seems like you would need to access the twitch api for a list of current viewers, then pick one at random. For more complexity, check to make sure it isn't the one actually using the roulette (so they don't pull the trigger on someone else, who the someone else is actually them).


My guess is use sockets to access twitch api, store a random viewer into a variable to be accessed within roulette.
I don't know exact syntax for these methods to post code, but maybe this can help you get started.
-Aeon

Joined: Jan 2014
Posts: 107
M
Majeye Offline OP
Vogon poet
OP Offline
Vogon poet
M
Joined: Jan 2014
Posts: 107
Originally Posted By: AeonPsych
in the code for when the number is right to shoot, just add a reference to the add/remove points alias.

As for targeting 2 different viewers, you would have to have the code within roulette identify another user, or have the command pre-identify another user. I'm not sure how to identify another user, but I am sure it is possible, and fairly easy to do, just need to figure out the syntax for it.

Off the top of my head, seems like you would need to access the twitch api for a list of current viewers, then pick one at random. For more complexity, check to make sure it isn't the one actually using the roulette (so they don't pull the trigger on someone else, who the someone else is actually them).


My guess is use sockets to access twitch api, store a random viewer into a variable to be accessed within roulette.
I don't know exact syntax for these methods to post code, but maybe this can help you get started.
-Aeon


That information actually is super helpful.. I will start looking things up to see if I can figure it out myself...

In the meantime, does anyone else know what the syntax would be? (just to help shorten my search time)

Joined: Jul 2014
Posts: 48
A
Ameglian cow
Offline
Ameglian cow
A
Joined: Jul 2014
Posts: 48
https://api.twitch.tv/kraken/channels/#channelNameHere/follows

That is the official twitch api for a list of your current followers. Replace #channel with your channel obviously. Only problem (at least for me) is that the response is json format. Need a way to parse it. Otherwise, all the followers are there.




Link Copied to Clipboard