Twitch mirc bot problems reddit / irc ---------------------------------------------------------------------- Smoffsarn · 2015-09-03 21:47 Hi ! I dont know if this is the right place to post this but i need some help with my twitch mirc bot points command. If u see anything wrong in the copy paste please tell me :) I would also like to add a add points to user command cause that isent working. Here comes the copy paste.. alias -l addPoints { if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt } var %topic $+($chan,.,$nick) var %points $calc($readini(Points.ini,%topic,Points) + $1) writeini -n Points.ini %topic Points %points return %points } alias -l lookUpPoints { var %topic $+($chan,.,$nick) var %points $readini(Points.ini,%topic,Points) return %points } alias doaddpoints { if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt } var %topic $+($1,.,$2) var %points $calc($readini(Points.ini,%topic,Points) + $3) writeini -n Points.ini %topic Points %points echo -a Added points for %topic } alias dorempoints { var %topic $+($1,.,$2) remini -n Points.ini %topic Points echo -a Removed points for %topic } on !*:join:#:{ $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick) add.pts $+(#,.,$nick) } on !*:part:#:$+(.timerpoints.,#,.,$nick) off alias -l add.pts { writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1) } ON !*:TEXT:!*:#: { tokenize 32 $strip($1-,burci) if ($1 == !points) { if (!$2) { if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return } set -u10 %floodpoints On set -u30 %floodpoints. $+ $nick On msg # $nick has $iif($readini(Points.ini,$+(#,.,$nick),Points),$v1,0) total points. } elseif ($2) { if ($nick isop #) { if ($0 < 3) { msg # Insufficient parameters: Use !points [number] | return } writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1)) msg $chan $3 now has $iif($readini(Points.ini,$+(#,.,$3),Points),$v1,0) total points. } else { msg $chan This command is only available to moderators. } } } ---------------------------------------------------------------------- lemon65 · 2015-09-04 01:12 On the train now but I can give you some example code later for my twitch IRC bot. ---------------------------------------------------------------------- Xangold · 2015-09-04 08:38 a) Post this on gist.github.com b) Use a code formatter so that curly braces are like this stuff { two spaces before a line { next line stuff! } } You will REALLY thank yourself for it later. It makes it 100% easier to read and debug. Ideally programs shouldn't have more than 80 or so columns (words in a line).