I've been posting questons regarding this small script I've created it with the help of you guys, now there is only 1 problem coming up.
The code is:
Code: Select all
set ac(chan) "#channel"
set notifyusers "owner"
set ac(bot_username) "username"
set ac(owner_username) "owner"
bind dcc n bonus ac:bonus
bind notc - "USER: * ACCESS: *" ac:bonus_points
proc ac:bonus {hand idx arg} {
global ac baccess
set arg [split $arg]
set username1 [lindex $arg 0]
set reason1 [lrange $arg 1 end]
if {$username1 == ""} { putdcc $idx "Syntax: .bonus <CService Username> <Reason>"; return }
if {$username1 == "$ac(bot_username)"} { putdcc $idx "You can't bonus me or I can't modify myself."; return }
if {$username1 == "$ac(owner_username)"} { putdcc $idx "Do you think $ac(owner_username) needs modification?, get a life."; return }
if {$reason1 == ""} { putdcc $idx "Syntax: .bonus <CService Username> <Reason>. You're required to mention reason for bonus."; return }
puthelp "PRIVMSG X :ACCESS $ac(chan) $username1"
set baccess([string tolower $username1]) [list $hand $reason1]
}
proc ac:bonus_points {nick uhost hand arg dest} {
global ac baccess notifyusers
if {![isbotnick $dest]} {return 0}
if {![string equal -nocase X $nick]} {return 0}
set user [string tolower [lindex [split $arg] 1]]
if {![info exists baccess($user)]} {return 0}
foreach {handle reason} $baccess($user) {break}
set access [lindex [split $arg] 3]
puthelp "PRIVMSG X :MODINFO $ac(chan) ACCESS $user [expr {$access + 5}]"
if {$notifyusers != "" && $notifyusers != " "} {
foreach notfuser $notifyusers {
sendnote IDA_SYSTEM $notfuser "Bonus +5 given to $user by $handle in $ac(chan). The reason was: $reason"
}
}
}
The bot is increasing/modifying +5 to him BUT whenver bot recieves this message, the bot starts modifying other people too..bonus <CService USername> <Reason>
Code: Select all
-X- USER: username ACCESS: 123 LU
-X- CHANNEL: #channel -- AUTOMODE: OP
-X- LAST SEEN: 0 days, 00:07:07 ago.
-X- End of access list
I will be grateful to you if you kindly fix / help me out of it.
Thanks.