###################################
#Karma 1.0 ComputerTech
###################################
#Usage
###################################
#!++nick 1 << Increases nicks reputation to +1
array set act {
++
--
}
set actcmd "!"
bind pub - "${actcmd}$act*" do:act:hehe
proc do:act:hehe {nick host hand chan text} {
set var0 "[lindex [split $text] 0 ]"
set blah($var0) 0
if {[$act eq "++"]} { ;incr blah($var0) +1
} else {
incr blah($var0) -1
putserv "PRIVMSG $chan :$var0 now has Reputation blah($var0)"
}
}
it's meant to be a !karma script
like one from bitbot, so you do !nick++ to increase their reputation, and !nick-- to decrease their reputation, thanks in advanced
And how would i check if !nick++ or !nick-- was used?
Like to use "if" command to find which one was used?
Thanks in advanced
EDIT, another thing, how can i check if blah($var0) is -1 or +1, so if rhe current amount is +1 it will show on the putserv "output" either + or - with the value, Make sense?
Last edited by ComputerTech on Sat Nov 21, 2020 9:55 am, edited 1 time in total.
.tcl proc karma {nick uhost handle chan text} { putlog "binded with $text"}
.tcl bind pubm - "#% !%++" karma
<me> !rasp++
[14:49] triggering bind karma
[14:49] binded with !rasp++
<me> !rasp++ test
(nothing)
[14:49] triggering bind karma
.tcl bind pubm - "#% !%++*" karma
<me> !rasp++ test
[14:53] triggering bind karma
[14:53] binded with !rasp++ test
Your proc must get the first item of $text and cut it:
1st char is the command symbol (!)
Last 2 chars are the modifier (++ or --)
Everyting else is the nick:
.tcl set text !rasp++
[14:58] tcl: builtin dcc call: *dcc:tcl CrazyCat 12 set text !rasp++
[14:58] tcl: evaluate (.tcl): set text !rasp++
Tcl: !rasp++
.tcl set cmd [string index $text 0]
[14:58] tcl: builtin dcc call: *dcc:tcl CrazyCat 12 set cmd [string index $text 0]
[14:58] tcl: evaluate (.tcl): set cmd [string index $text 0]
Tcl: !
.tcl set mod [string range $text end-1 end]
[14:58] tcl: builtin dcc call: *dcc:tcl CrazyCat 12 set mod [string range $text end-1 end]
[14:58] tcl: evaluate (.tcl): set mod [string range $text end-1 end]
Tcl: ++
.tcl set unick [string range $text 1 end-2]
[14:59] tcl: builtin dcc call: *dcc:tcl CrazyCat 12 set unick [string range $text 1 end-2]
[14:59] tcl: evaluate (.tcl): set unick [string range $text 1 end-2]
Tcl: rasp
Basically if -0. it will show -1 and not just keep 0 as the lowest number, so if - rhat will fall into the hated category and if above -0 it will be on the love side
All new nicks will start off with 0 neither + or -