mIRC Homepage
Posted By: FireHawkFigg help with a script idea - 28/02/17 01:59 AM
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!!
}
}
}
}


Posted By: splinny Re: help with a script idea - 28/02/17 12:38 PM
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.
Posted By: FireHawkFigg Re: help with a script idea - 01/03/17 12:49 AM
Would there be anyway i could see an example of what your suggesting, still slowly learning about all of it.
Posted By: splinny Re: help with a script idea - 01/03/17 06:10 AM
Are you sure you want to code a chatbot, instead of getting one of many exsiting and free?
Posted By: FireHawkFigg Re: help with a script idea - 02/03/17 03:33 AM
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.
Posted By: splinny Re: help with a script idea - 02/03/17 09:06 AM
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)
© mIRC Discussion Forums