mIRC Home    About    Download    Register    News    Help

Print Thread
desperately need help w/ queue for twitch viewers #261414 29/09/17 04:10 AM
Joined: Sep 2017
Posts: 32
K
kouyachi Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Sep 2017
Posts: 32
so i've literally looked everywhere and i'm so so clueless about all of this (and i need straight-forward answers like where to actually Put all the coding). i'm in need of a twitch viewer queue system, where viewers can join a queue (a line basically) so they can play with me since i've been getting more and more people wanting to play with me, it's getting hectic. i need a line system so people can join the queue, know when they're up next, etc.

commands like: !join (to join the queue), !leave (to leave the queue). can someone please help

Re: desperately need help w/ queue for twitch viewers [Re: kouyachi] #261418 29/09/17 10:51 AM
Joined: Feb 2003
Posts: 2,784
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,784
Writing a bot from scratch is a fairly complex endeavor, and managing interactions like this quickly spirals into a highly intricate or otherwise very convoluted feature set. I'm not aware of any open source premade bots out there, but a lot of people are selling them for a fee or subscription.

I wouldn't suppose you have a budget to encourage such an undertaking?

In its simplest form, here is an example queuing system with only basic flood protection. It does not take into account any finer chat dynamics than people simply adding and removing themselves from a list, with a few commands to manipulate it yourself. It can easily be expanded 100 times its size to prevent other flood abuses, support multiple channels or games, collect player history, or gather other information about player rankings and chat loyalty and such statistics.

Code:
; untested.

; Commands: /PlayQueue /SayQueue /ClearQueue /RemPlayer <Nickname>

On *:TEXT:!join:#MyChannel: { ; <--- Edit the channel name!
  if ($istok(%PlayQueue,$nick,32)) || ($istok(%PlayLeft,$nick,32)) { return }
  set -u7200 %PlayQueue %PlayQueue $nick
  msg $chan [Play Queue] Thank you, $nick $+ . You are $ord($numtok(%PlayQueue,32)) in line. Stick around, don't !leave
} ; by Raccoon 2017

On *:TEXT:!leave:#MyChannel: { ; <--- Edit the channel name!
  if (!$istok(%PlayQueue,$nick,32)) || ($istok(%PlayLeft,$nick,32)) { return }
  set -u7200 %PlayQueue $remtok(%PlayQueue,$nick,0,32)
  set -u300 %PlayLeft %PlayLeft $nick
  msg $chan [Play Queue] Sorry you have to go, $nick $+ . There are now $numtok(%PlayQueue,32) in line.
} ; by Raccoon 2017

ALIAS PlayQueue {
  echo -atic notice * [Play Queue] There are $numtok(%PlayQueue,32) players in queue: %PlayQueue
  if (%PlayLeft) echo -atic notice * [Play Queue] $numtok(%PlayLeft,32) left but can join again in $ceil($calc($var(%PlayLeft).secs / 60)) minute(s): %PlayLeft
} ; by Raccoon 2017

ALIAS SayQueue {
  say [Play Queue] There are $numtok(%PlayQueue,32) players in queue: %PlayQueue
} ; by Raccoon 2017

ALIAS ClearQueue {
  unset %PlayQueue %PlayLeft
  echo -atic notice * [Play Queue] Cleared the player queue.
} ; by Raccoon 2017

ALIAS RemPlayer {
  set -u7200 %PlayQueue $remtok(%PlayQueue,$1,0,32)
  echo -atic notice * [Play Queue] There are $numtok(%PlayQueue,32) players in queue: %PlayQueue
} ; by Raccoon 2017


That took me about 37 minutes to compose from scratch. It's very basic.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: desperately need help w/ queue for twitch viewers [Re: Raccoon] #261419 29/09/17 04:46 PM
Joined: Sep 2017
Posts: 32
K
kouyachi Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Sep 2017
Posts: 32
yeah i saw some that require monthly fees but don't really have the funds for it ;-; but thank you so for much for this i really appreciate it!

Last edited by kouyachi; 29/09/17 04:47 PM.