Customizable Bot
Posted by Fubar
Sunday, June 20, 2004
Description: Customizable Bot for Clans or Companys
I thought i'd make something for the starting out without-a-scripter clans and companies. You put this on a different mIRC client and put it in that client's remotes(Alt+R)
I thought i'd make something for the starting out without-a-scripter clans and companies. You put this on a different mIRC client and put it in that client's remotes(Alt+R)
on *:CONNECT: {
hmake commands 500
hmake privcommands 500
hload commands %clanbot.defaultcommands
hload privcommands %clanbot.defaultpriv
join %clanbot.channel
}
on *:LOAD: {
hmake commands 500
hmake privcommands 500
hload commands %clanbot.defaultcommands
hload privcommands %clanbot.defaultpriv
}
alias clanbot {
dialog -m clanbotsetup clanbotsetup
}
menu status {
Clanbot
.Setup { clanbot }
}
dialog clanbotsetup {
title "Clanbot"
size -1 -1 222 154
option dbu
tab "Command Info", 1, -1 -1 224 155
list 2, 113 41 110 112, tab 1 size hsbar vsbar
list 3, 1 41 110 112, tab 1 size vsbar
edit "", 4, 1 30 218 10, tab 1
text , 5, 2 22 182 8, tab 1
button "Save", 33, 189 18 28 12, tab 1
tab "Priv Commands Info", 6
list 18, 113 41 110 112, tab 6 size hsbar vsbar
list 19, 1 41 110 112, tab 6 size vsbar
edit "", 20, 1 30 218 10, tab 6
button "Save", 34, 189 18 28 12, tab 6
text , 21, 2 22 182 8, tab 6
tab "Commands", 7
button "Add Command", 10, 178 37 43 12, tab 7
button "Del Command", 9, 178 50 43 12, tab 7
button "Load Commands", 12, 178 127 44 12, tab 7
button "Save Commands", 11, 178 140 44 12, tab 7
list 8, 0 37 176 116, tab 7 size
tab "Priv Commands", 17
list 23, 0 37 176 116, tab 17 size
button "Add Command", 24, 178 37 43 12, tab 17
button "Del Command", 25, 178 50 43 12, tab 17
button "Load Commands", 26, 178 127 44 12, tab 17
button "Save Commands", 27, 178 140 44 12, tab 17
tab "Setup", 22
edit "", 16, 95 18 10 10, tab 22 limit 1
text "Trigger", 15, 75 19 19 8, tab 22
edit "#", 14, 23 18 50 10, tab 22
text "Channel", 13, 1 20 21 8, tab 22
box "Theme", 28, 106 17 115 46, tab 22
text "Theme Start", 29, 109 25 32 8, tab 22
edit "", 30, 141 24 78 10, tab 22
text "Theme End", 32, 109 36 32 8, tab 22
edit "", 31, 141 35 78 10, tab 22
text "Roster ", 35, 5 30 19 8, tab 22
text "Current", 36, 26 30 21 8, tab 22
edit "", 37, 48 29 10 10, tab 22
text "/ Max", 38, 59 30 16 8, tab 22
edit "", 39, 75 29 10 10, tab 22
button "Save", 40, 1 140 37 12, tab 22
box "Colours", 41, 106 62 82 28, tab 22
text "Colour 1", 42, 109 69 25 8, tab 22
edit "", 43, 135 67 50 10, tab 22
text "Colour 2", 44, 109 80 25 8, tab 22
edit "", 45, 135 78 50 10,tab 22
text "Seperator", 46, 109 46 32 8, tab 22
edit "", 47, 141 45 78 10, tab 22
}
dialog acom {
title "Add command"
size -1 -1 142 58
option dbu
edit "", 1, 2 11 50 10
text "Command [trigger not required]", 2, 3 2 142 8
text "Info for command", 3, 3 23 44 8
edit "", 4, 2 32 139 10
button "Add Command", 5, 3 43 40 12
button "Reset", 6, 104 43 37 12
}
on *:DIALOG:clanbotsetup:init:0: {
var %i 1
while (%i <= $hget(commands,0).item) {
did -a clanbotsetup 3 $hget(commands,%i).item
did -a clanbotsetup 2 $hget(commands,$hget(commands,%i).item)
inc %i
}
var %i 1
while (%i <= $hget(privcommands,0).item) {
did -a clanbotsetup 19 $hget(privcommands,%i).item
did -a clanbotsetup 18 $hget(privcommands,$hget(privcommands,%i).item)
inc %i
}
var %i 1
while (%i <= $hget(commands,0).item) {
did -a clanbotsetup 8 $hget(commands,%i).item
inc %i
}
var %i 1
while (%i <= $hget(privcommands,0).item) {
did -a clanbotsetup 23 $hget(privcommands,%i).item
inc %i
}
did -ra clanbotsetup 14 %clanbot.channel
did -ra clanbotsetup 30 %clanbot.theme1
did -ra clanbotsetup 31 %clanbot.theme2
did -ra clanbotsetup 37 $gettok(%clanbot.rosternumber,1,47)
did -ra clanbotsetup 39 $gettok(%clanbot.rosternumber,2,47)
did -ra clanbotsetup 16 %clanbot.trigger
did -ra clanbotsetup 43 $right(%clanbot.colour1,-1)
did -ra clanbotsetup 45 $right(%clanbot.colour2,-1)
did -ra clanbotsetup 47 %clanbot.theme3
}
on *:DIALOG:acom:sclick:5: {
if (%clanbot.privcommand == 1) {
if ($didwm(clanbotsetup,23,* $+ $did(acom,1).text,1)) {
$input(The command $+(",$did(Acom,1).text,") already exists.,0,Command Exists)
}
if (!$did(acom,1).text) {
$input(Please supply a command name,0,Insufficient Parameters)
halt
}
else {
did -a clanbotsetup 23 $did(Acom,1).text
did -a clanbotsetup 19 $did(Acom,1).text
did -a clanbotsetup 18 $did(acom,4).text
hadd privcommands $did(Acom,1).text $iif($did(acom,4).text,$did(acom,4).text,$did(acom,1).text goes here)
unset %clanbot.privcommand
dialog -x acom acom
}
}
else {
if ($didwm(clanbotsetup,8,* $+ $did(acom,1).text,1)) {
!$input(The command $+(",$did(Acom,1).text,") already exists.,0,Command Exists)
}
if (!$did(acom,1).text) {
!$input(Please supply a command name,0,Insufficient Parameters)
halt
}
else {
did -a clanbotsetup 8 $did(Acom,1).text
did -a clanbotsetup 3 $did(Acom,1).text
did -a clanbotsetup 2 $iif($did(acom,4).text,$did(acom,4).text,$did(acom,1).text goes here)
hadd commands $did(Acom,1).text $did(acom,4).text
dialog -x acom acom
}
}
}
on *:DIALOG:clanbotsetup:sclick:24: {
set %clanbot.privcommand 1
dialog -mav acom acom
}
on *:DIALOG:clanbotsetup:sclick:10: {
unset %clanbot.privcommand
dialog -mav acom acom
}
on *:DIALOG:clanbotsetup:sclick:3: {
did -a clanbotsetup 5 $did(3).seltext
did -ar clanbotsetup 4 $did(2,$did(3).sel).text
}
on *:DIALOG:clanbotsetup:sclick:19: {
did -a clanbotsetup 21 $did(19).seltext
did -ar clanbotsetup 20 $did(18,$did(19).sel).text
}
on *:DIALOG:clanbotsetup:sclick:33: {
if ($did(5).text) {
hadd commands $did(5).text $did(4).text
did -o clanbotsetup 2 $didwm(clanbotsetup,2,$did(5).text $+ *,1) $did(4).text
}
}
on *:DIALOG:clanbotsetup:sclick:34: {
if ($did(21).text) {
hadd privcommands $did(21).text $did(20).text
did -o clanbotsetup 18 $didwm(clanbotsetup,19,$did(21).text $+ *,1) $did(20).text
}
}
on *:DIALOG:clanbotsetup:sclick:27: {
var %clanbot.temp " $+ $sfile(*.clb,Save File,Save)) $+ "
.hsave privcommands %clanbot.temp
set %clanbot.defaultpriv %clanbot.temp
}
on *:DIALOG:clanbotsetup:sclick:11: {
var %clanbot.temp " $+ $sfile(*.clb,Save File,Save)) $+ "
.hsave commands %clanbot.temp
set %clanbot.defaultcommands %clanbot.temp
}
on *:DIALOG:clanbotsetup:sclick:26: {
var %clanbot.temp " $+ $sfile(*.clb,Load File,Load)) $+ "
.hload privcommands %clanbot.temp
dialog -x $dname $dname
dialog -m clanbotsetup clanbotsetup
set %clanbot.defaultpriv %clanbot.temp
}
on *:DIALOG:clanbotsetup:sclick:12: {
var %clanbot.temp " $+ $sfile(*.clb,Load File,Load) $+ "
.hload commands %clanbot.temp
dialog -x $dname $dname
dialog -m clanbotsetup clanbotsetup
set %clanbot.defaultcommands %clanbot.temp
}
on *:DIALOG:clanbotsetup:sclick:9: {
if ($did(8).sel) {
if ($input(Delete Command " $+ $did(8).seltext $+ ?",0,Delete Command) == $true) {
hdel commands $did(8).seltext
did -d clanbotsetup 8 $did(8).sel
}
}
}
on *:DIALOG:clanbotsetup:sclick:25: {
if ($did(23).sel) {
if ($input(Delete Command " $+ $did(23).seltext $+ ?",0,Delete Command) == $true) {
hdel privcommands $did(23).seltext
did -d clanbotsetup 23 $did(23).sel
}
}
}
on *:DIALOG:clanbotsetup:sclick:40: {
set %clanbot.channel $did(14).text
set %clanbot.theme1 $did(30).text
set %clanbot.theme2 $did(31).text
set %clanbot.theme3 $did(47).text
set %clanbot.rosternumber $did(37).text $+ / $+ $did(39).text
set %clanbot.trigger $did(16).text
set %clanbot.colour1 [^K] $+ $gettok($did(43).text,1,44) $+ $iif($gettok($did(43).text,2,44),$chr(44) $+ $base($gettok($did(43).text,2,44),10,10,2))
set %clanbot.colour2 [^K] $+ $gettok($did(45).text,1,44) $+ $iif($gettok($did(45).text,2,44),$chr(44) $+ $base($gettok($did(45).text,2,44),10,10,2))
}
alias capit {
return %clanbot.colour1 $+ %clanbot.trigger $+ %clanbot.colour2 $+ $upper($left($1,1)) $+ $lower($right($1-,-1))
}
on *:TEXT:$(%clanbot.trigger $+ *):%clanbot.channel: {
if ($remove($1,%clanbot.trigger) == set) {
if ($nick !isop $chan) {
.notice $nick %clanbot.theme1 %clanbot.colour1 $+ Y $+ %clanbot.colour2 $+ ou do not have access to this command %clanbot.theme2
}
else {
if ($hget(commands,$2)) {
hadd commands $2 $3-
.notice $nick %clanbot.theme1 %clanbot.colour1 $+ Y $+ %clanbot.colour2 $+ ou have set the %clanbot.colour1 $+ " $+ %clanbot.colour2 $+ $2 $+ %clanbot.colour1 $+ " $+ %clanbot.colour2 command %clanbot.theme2
}
elseif ($hget(privcommands,$2)) {
hadd commands $2 $3-
.notice $nick %clanbot.theme1 %clanbot.colour1 $+ Y $+ %clanbot.colour2 $+ ou have set the %clanbot.colour1 $+ " $+ %clanbot.colour2 $+ $2 $+ %clanbot.colour1 $+ " $+ %clanbot.colour2 command %clanbot.theme2
}
elseif ($2 == rosternumber) {
if ($3 > $gettok(%clanbot.rosternumber,2,47)) {
.notice $nick %clanbot.theme1 %clanbot.colour1 $+ T $+ %clanbot.colour2 $+ he $+(%clanbot.colour1,R,%clanbot.colour2,oster,$chr(32),%clanbot.colour1,N,%clanbot.colour2,umber) %clanbot.colour2 $+ cannot be higher than %clanbot.colour1 $+ $remove($gettok(%clanbot.rosternumber,2,47),[^B]FULL[^B]) %clanbot.theme2
halt
}
if ($3 == $gettok(%clanbot.rosternumber,2,47)) {
.notice $nick %clanbot.theme1 %clanbot.colour1 $+ T $+ %clanbot.colour2 $+ he $+(%clanbot.colour1,R,%clanbot.colour2,oster) %clanbot.colour2 $+ is now full %clanbot.theme2
set %clanbot.rosternumber $3 $+ / $+ $3 [^B]FULL[^B]
halt
}
else {
set %clanbot.rosternumber $3 $+ / $+ $remove($gettok(%clanbot.rosternumber,2,47),[^B]FULL[^B])
.notice $nick %clanbot.theme1 %clanbot.colour1 $+ Y $+ %clanbot.colour2 $+ ou have set the $+(%clanbot.colour1,R,%clanbot.colour2,oster,$chr(32),%clanbot.colour1,N,%clanbot.colour2,umber) %clanbot.theme2
}
}
else {
.notice $nick %clanbot.theme1 %clanbot.colour1 $+ T $+ %clanbot.colour2 $+ he command %clanbot.colour1 $+ " $+ %clanbot.colour2 $+ $2 $+ %clanbot.colour1 $+ " $+ %clanbot.colour2 does not exist %clanbot.theme2
}
}
}
if ($1 == %clanbot.trigger $+ commands) {
if ($nick isop $chan) {
var %i 1
while (%i <= $hget(commands,0).item) {
set %clanbot.commandstemp %clanbot.commandstemp %clanbot.theme3 $capit($hget(commands,%i).item)
inc %i
}
var %i 1
while (%i <= $hget(privcommands,0).item) {
set %clanbot.commandstemp %clanbot.commandstemp %clanbot.theme3 $capit($hget(privcommands,%i).item)
inc %i
}
.notice $nick %clanbot.theme1 %clanbot.colour1 $+ C $+ %clanbot.colour2 $+ ommands: %clanbot.commandstemp %clanbot.theme2
unset %clanbot.commandstemp
}
else {
var %i 1
while (%i <= $hget(commands,0).item) {
set %clanbot.commandstemp %clanbot.commandstemp %clanbot.theme3 $capit($hget(commands,%i).item)
inc %i
}
.notice $nick %clanbot.theme1 %clanbot.colour1 $+ C $+ %clanbot.colour2 $+ ommands: %clanbot.commandstemp %clanbot.theme2
unset %clanbot.commandstemp
}
}
if ($hget(commands,$remove($1,%clanbot.trigger))) {
.notice $nick %clanbot.theme1 $+(%clanbot.colour1,$upper($left($remove($1,%clanbot.trigger),1)),%clanbot.colour2,$right($remove($1,%clanbot.trigger),-1)) $+ : $hget(commands,$remove($1,%clanbot.trigger)) $iif($remove($1,%clanbot.trigger) == roster,$+(%clanbot.colour2,%clanbot.rosternumber)) %clanbot.theme2
}
if ($hget(privcommands,$remove($1,%clanbot.trigger))) {
if ($nick isop $chan) {
.notice $nick %clanbot.theme1 $+(%clanbot.colour1,$upper($left($remove($1,%clanbot.trigger),1)),%clanbot.colour2,$right($remove($1,%clanbot.trigger),-1)) $+ : $hget(privcommands,$remove($1,%clanbot.trigger)) %clanbot.theme2
}
else {
.notice $nick %clanbot.theme1 %clanbot.colour1 $+ Y $+ %clanbot.colour2 $+ ou do not have access to this command %clanbot.theme2
}
}
}