mIRC Home    About    Download    Register    News    Help

Print Thread
#260093 28/02/17 01:59 AM
Joined: Feb 2017
Posts: 3
F
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Feb 2017
Posts: 3
I'm not sure if this is even possible or not but I am coding a chatbot for a friend of mine who we designed a system called the bscup.

What we are looking to do is using the vars.ini file because the counters are %bsxist.times so in the vars.ini file it will be %bsxist.times 1.... so on and so forth.. back to the original question, is is possible by using the vars.ini file to make a script that reads through it and picking a winner with the highest number of credits in the cup and post it to the channel. Then after it is posted be able to clear the counters to 0 for the next chapter of the story.

Below is the current code being used.

on *:TEXT:!bstrec:#: {
if ($chan == #xxxxxxx) {
if ($nick isop #) {
if ($1 == !bstrec) { inc %bstrec.times | .msg $chan Uh yeah...Aliens! ... And another credit added to Trecs Bullshit Cup! %bstrec.times credits have landed in the cup!!
}
}
}
}



Last edited by FireHawkFigg; 28/02/17 02:03 AM.
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
You dont need to read vars.ini. If you store users points in %vars, like %points.username1, %points.username2, etc. - you can use $var(%points.*,0) to get total number of them and then check one by one with $var(%points.*,%x) to find winner.


Dont give a fish - teach to fish!
Joined: Feb 2017
Posts: 3
F
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Feb 2017
Posts: 3
Would there be anyway i could see an example of what your suggesting, still slowly learning about all of it.

Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Are you sure you want to code a chatbot, instead of getting one of many exsiting and free?


Dont give a fish - teach to fish!
Joined: Feb 2017
Posts: 3
F
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Feb 2017
Posts: 3
I already maintain currently 3 irc chatbots for 3 different streamers, I enjoy being able to learn how scripting works. and being able to have full control of the aspects and how they work.

Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Code:
vars.ini:
%points.Fire 15
%points.Hawk 23
%points.Figg 47

$var(points.*,0) = 3
$var(points.*,1) = %points.Fire
$($var(points.*,1),2) = 15
$($var(points.*,1),1) = %points.Fire
$($var(points.*,1),0) = $var(points.*,1)

Last edited by splinny; 02/03/17 09:07 AM.

Dont give a fish - teach to fish!

Link Copied to Clipboard