mIRC Homepage
Posted By: Majeye Roulette additions - 21/07/14 02:39 AM
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. }

  }
}
Posted By: AeonPsych Re: Roulette additions - 21/07/14 05:50 AM
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
Posted By: Majeye Re: Roulette additions - 21/07/14 09:20 AM
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)
Posted By: AeonPsych Re: Roulette additions - 22/07/14 07:24 AM
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.


© mIRC Discussion Forums