Anyone can help me on how can I combine 2 TCL scripts (Status.tcl v1.0.0 By Kissmine and Ban Counter by BarkerJr) into 1 script. For example, I would like to publish my eggdrop total banlist when someone trigger !status (not one trigger for !bans and one for !status ONLY trigger !status then Ban Counter appears) as below;
proc asus_status {nick uhost hand chan vasus} {
global botnick asus timezone version admin uptime server server-online
catch {exec hostname} asus(hostname)
if {$asus(msgtype) == "2"} {
set asus_who $chan
} else {
set asus_who $nick
}
asus_msg $asus_who "\002Status\002 - [ctime [unixtime]] $timezone"
if {$asus(bot) == "0"} {set asus(bote) Eggdrop} else {set asus(bote) Windrop}
asus_msg $asus_who "I am $botnick, running $asus(bote) [lindex $version 0]"
asus_msg $asus_who "Running on $asus(hostname) [unames]"
asus_msg $asus_who "Owner $admin"
asus_msg $asus_who "Have [countusers] People In User File"
asus_msg $asus_who "Total Bans: $ctr bans" <- FROM BAN COUNTER SCRIPT.
asus_msg $asus_who "Channels, [channels]"
if {$asus(bot) == "0"} {catch {exec uptime} asus(uptime)} else {set asus(uptime) [duration [expr [clock clicks] / 1000]]}
asus_msg $asus_who "Online for [asus_time $uptime]"
asus_msg $asus_who "Box Stats: $asus(uptime)"
asus_msg $asus_who "Connected to $server for [asus_time ${server-online}]"
asus_msg $asus_who "\002End of Status\002 - Status.Tcl v$asus(version)"
}
Original Scripts as below;
A). Status.tcl
### What is your bot (Eggdrop = 0 / Windrop = 1)
### Default: set asus(bot) "0"
set asus(bot) "0"
### What type of msg do you want (MSG = 0 / NOTICE = 1 / CHAN = 2)
### Note: If you set 2, the bot will Msg the chan the status
### Otherwise it will msg/notice the users that triggers it
set asus(msgtype) "2"
### What is the trigger that you like???
### Default: set asus(trig) "!"
set asus(trig) "!"
### What flag is needed to trigger
### Default: set asus(flag) "m"
set asus(flag) "m"
### Plz dont edit anything past this line ###
### Unless you know what you are doing ###
set asus(version) "1.0.0"
putlog "Status.tcl v$asus(version) by Kissmine \002loaded\002"
bind PUB $asus(flag) $asus(trig)status asus_pub_status
bind MSG $asus(flag) status asus_msg_status
proc asus_msg {who what} {
global asus
if {$asus(msgtype) == "1"} {
puthelp "NOTICE $who :$what"
} else {
puthelp "PRIVMSG $who :$what"
}
}
proc asus_pub_status {nick uhost hand chan vasus} {
global asus botnick
asus_status $nick $uhost $hand $chan $vasus
}
proc asus_msg_status {nick uhost hand vasus} {
global asus botnick
set chan [lindex [split $vasus] 0]
if {$asus(msgtype) == "2"} {
if {[lindex $vasus 0] == ""} {
puthelp "NOTICE $nick :Usage: /msg $botnick status <#chan>"
return 0
}
}
asus_status $nick $uhost $hand $chan $vasus
}
proc asus_status {nick uhost hand chan vasus} {
global botnick asus timezone version admin uptime server server-online
catch {exec hostname} asus(hostname)
if {$asus(msgtype) == "2"} {
set asus_who $chan
} else {
set asus_who $nick
}
asus_msg $asus_who "\002Status\002 - [ctime [unixtime]] $timezone"
if {$asus(bot) == "0"} {set asus(bote) Eggdrop} else {set asus(bote) Windrop}
asus_msg $asus_who "I am $botnick, running $asus(bote) [lindex $version 0]"
asus_msg $asus_who "Running on $asus(hostname) [unames]"
asus_msg $asus_who "Owner $admin"
asus_msg $asus_who "Have [countusers] People In User File"
asus_msg $asus_who "Channels, [channels]"
if {$asus(bot) == "0"} {catch {exec uptime} asus(uptime)} else {set asus(uptime) [duration [expr [clock clicks] / 1000]]}
asus_msg $asus_who "Online for [asus_time $uptime]"
asus_msg $asus_who "Box Stats: $asus(uptime)"
asus_msg $asus_who "Connected to $server for [asus_time ${server-online}]"
asus_msg $asus_who "\002End of Status\002 - Status.Tcl v$asus(version)"
}
proc asus_time {time} {
set ltime [expr [unixtime] - $time]
set seconds [expr $ltime % 60]
set ltime [expr ($ltime - $seconds) / 60]
set minutes [expr $ltime % 60]
set ltime [expr ($ltime - $minutes) / 60]
set hours [expr $ltime % 24]
set days [expr ($ltime - $hours) / 24]
set asus_times ""
if {$days} {
append asus_times "$days "
if {$days == "1"} {
append asus_times "day "
} else {
append asus_times "days "
}
}
if {$hours} {
append asus_times "$hours "
if {$hours == "1"} {
append asus_times "hour "
} else {
append asus_times "hours "
}
}
if {$minutes} {
append asus_times "$minutes "
if {$minutes == "1"} {
append asus_times "minute "
} else {
append asus_times "minutes"
}
}
if {$seconds} {
append asus_times " $seconds "
if {$seconds == "1"} {
append asus_times "second"
} else {
append asus_times "seconds"
}
}
return $asus_times
}
B). Ban Counter
set cmdchar "!"
bind pub n|- ${cmdchar}bans pub:bans
proc pub:bans {nick uhost hand chan arg} {
set ctr 0
set bans [banlist]
while {[lindex $bans $ctr] != ""} {
set ctr [expr $ctr + 1]
}
puthelp "PRIVMSG $chan :$nick, Total Bans: $ctr bans."
return 1
}
Thanks for your help
