Directions:
Paste the code into your remotes section.
To add yourself as Admin you will need to open the Dialog
Enter:
/Dialog -m iBot iBot
After you have added youself as Admin, get the bot to the channel you want, and all of that. When you join the channel, you should be given Moderator status in the room, assuming the bot had it first.
If not then something went wrong.
Note:
This bot would need Admin/Oper Status to fully work.
Version 1.2
Version 2.1
dialog iBot {
Title "iBot v2.1 Created and Scripted by Pibb "
Size -1 -1 155 64
Option dbu
Text "Options are for setting Admin/Mods/Voiced users for iBot", 1, 5 5 150 25
button "Admin", 2, 5 20 40 10, ok flat
button "Mod", 3, 55 20 40 10, ok flat
button "Voiced", 4, 105 20 40 10, ok flat
Text "To Check for Updates, or leave comments and suggestions.", 5, 5 40 150 7
Text "Visit", 6, 5 49 10 10
Link "http://www.hawkee.com/snippet.php?snippet_id=1949", 7, 16 49 150 10
}
On *:Dialog:iBot:Sclick:2:{
Var %iBot.SetNick.Admin $?="Enter Admin Nickname"
Writeini iBot.ini %iBot.SetNick.Admin Admin Yes
Echo -a $Chr(91) $+ Added Admin - %iBot.SetNick.Admin $+ $Chr(93)
}
On *:Dialog:iBot:Sclick:3:{
Var %iBot.SetNick.Mod $?="Enter Mod Nickname"
Writeini iBot.ini %iBot.SetNick.Mod Level Mod
Echo -a $Chr(91) $+ Added Mod - %iBot.SetNick.Mod $+ $Chr(93)
}
On *:Dialog:iBot:Sclick:4:{
Var %iBot.SetNick.Voiced $?="Enter Voiced User Nickname"
Writeini iBot.ini %iBot.SetNick.Voiced Level Voice
Echo -a $Chr(91) $+ Added Voiced User - %iBot.SetNick.Voiced $+ $Chr(93)
}
On *:Dialog:iBot:Sclick:7:{
Run http://www.hawkee.com/snippet.php?snippet_id=1949
}
On *:Text:*:#:{
If ($Readini(iBot.ini, $Nick, Admin) == Yes) {
If ($1- == .Commands) {
.Notice $Nick $Chr(91) Command List for Admins $Chr(93)
/Timer 1 3 .Notice $Nick .Auto <Voice/Mod> <Add/Del> <NickName>
/Timer 1 6 .Notice $Nick <+/-> <Op/Voice/Quiet/Ban> <NickName>
/Timer 1 9 .Notice $Nick .<Kick/Invite> <NickName>
/Timer 1 12 .Notice $Nick .<Join/Part/Reg/UnReg/Kill> <ChannelName or NickName>
/Timer 1 15 .Notice $Nick <+/-> <Kline/AutoKill/Admin/Oper> <Ip or Nickname>
/Timer 1 18 .Notice $Nick <+/-> <Aop/Sop/Vop> <NickName>
/Timer 1 21 .Notice $Nick .Add <Joke/Fact/Quote> <Your Joke/Quote/Fact Here>
/Timer 1 24 .Notice $Nick .<Greet/Dictionary> <Add/Edit> <Your Greet/Dictionary Entry Here>
/Timer 1 27 .Notice $Nick .<Greet/Dictionary> <Del> <Name of Dictionary Entry/Leave blank for Greet>
}
Elseif ($1 == .Auto) {
If ($2 == Voice) {
If ($3 == Add) { writeini iBot.ini $4- Level Voice }
Elseif ($3 == Del) { remini iBot.ini $4- Level }
}
Elseif ($2 == Mod) {
If ($3 == Add) { Writeini iBot.ini $4- Level Mod }
Elseif ($3 == Del) { Remini iBot.ini $4- Level }
}
}
Elseif ($1 == .Kick) { Kick $Chan $2- }
Elseif ($1 == .Invite) { Invite $2- $Chan }
Elseif ($1 == .Join) { Join $2- }
Elseif ($1 == .Part) { Part $2- }
Elseif ($1 == .Reg) { Services Register $2- }
Elseif ($1 == .Unreg) { Services Drop $2- }
Elseif ($1 == .Kill) { Kill $2- }
Elseif ($1 == +) {
If ($2 == Op) { Mode $Chan +o $3- }
Elseif ($2 == Voice) { Mode $Chan +v $3- }
Elseif ($2 == Quiet) { Mode $Chan +q $3- }
Elseif ($2 == Ban) { Mode $Chan +b $3- }
Elseif ($2 == Kline) { Kline $3- }
Elseif ($2 == AKill) { Akill $3- }
Elseif ($2 == Admin) { Setoper +Admin $3- }
Elseif ($2 == Oper) { Setoper +Oper $3- }
Elseif ($2 == Aop) { Services AOP $Chan ADD $3- }
Elseif ($2 == Sop) { Services SOP $Chan ADD $3- }
Elseif ($2 == Vop) { Services VOP $Chan ADD $3- }
}
Elseif ($1 == -) {
If ($2 == Op) { Mode $Chan -o $3- }
Elseif ($2 == Voice) { Mode $Chan -v $3- }
Elseif ($2 == Quiet) { Mode $Chan -q $3- }
Elseif ($2 == Ban) { Mode $Chan -b $3- }
Elseif ($2 == Kline) { Unkline $3- }
Elseif ($2 == AKill) { Rakill $3- }
Elseif ($2 == Admin) { Setoper -Admin $3- }
Elseif ($2 == Oper) { Setoper -Oper $3- }
Elseif ($2 == Aop) { Services AOP $Chan DEL $3- }
Elseif ($2 == Sop) { Services SOP $Chan DEL $3- }
Elseif ($2 == Vop) { Services VOP $Chan DEL $3- }
}
Elseif ($1 == .Add) {
If ($2 == Joke) {
Write Jokes.txt $3- By: $Nick
.Notice $Nick $Chr(91) $+ Added Joke $+ $Chr(93) $3- By: $Nick $+ .
}
Elseif ($2 == Fact) {
Write Facts.txt $3- By: $Nick
.Notice $Nick $Chr(91) $+ Added Fact $+ $Chr(93) $3- By: $Nick $+ .
}
Elseif ($2 == Quote) {
Write Quotes.txt $3- By: $Nick
.Notice $Nick $Chr(91) $+ Added Quote $+ $Chr(93) $3- By: $Nick $+ .
}
Elseif ($2 == $Null) {
.Notice $Nick You didn't select a catagory
.Notice $Nick Correct usage: .Add <Joke/Fact/Quote>
}
}
Elseif ($1 == .Quote) { .Msg $Chan $Read(Quotes.txt) }
Elseif ($1 == .Joke) { .Msg $Chan $Read(Jokes.txt) }
Elseif ($1 == .Fact) { .Msg $Chan $Read(Facts.txt) }
Elseif ($1 == .Greet) {
If ($2 == Add) {
Writeini iBot.ini $Nick Greet $3-
.Notice $Nick $Chr(91) $+ Added Greet $+ $Chr(93) $3- $+ .
}
Elseif ($2 == Del) {
Remini iBot.ini $Nick Greet
.Notice $Nick $Chr(91) $+ Deleted Greet $+ $Chr(93) For $Nick $+ .
}
Elseif ($2 == Edit) {
Remini iBot.ini $Nick Greet
Writeini iBot.ini $Nick Greet $3-
.Notice $Nick $Chr(91) $+ Edited Greet $+ $Chr(93) $3- $+ .
}
Elseif ($2 == $Null) {
.Msg $Chan $Chr(91) $+ $Nick $+ $Chr(93) $Readini(iBot.ini, $Nick, Greet)
}
}
Elseif ($1 == .Dictionary) {
If ($2 == Add) {
Writeini iBot.ini $Nick $3 $4-
.Notice $Nick $Chr(91) $+ Added Dictionary Entry $+ $Chr(93) $3 $+ : $4- $+ .
}
Elseif ($2 == Del) {
Remini iBot.ini $Nick $3
.Notice $Nick $Chr(91) $+ Deleted Dictionary Entry $+ $Chr(93) $3 $+ .
}
Elseif ($2 == Edit) {
Remini iBot.ini $Nick $3
Writeini iBot.ini $Nick $3 $4-
.Notice $Nick $Chr(91) $+ Edited Dictionary Entry $+ $Chr(93) $3 $+ : $4- $+ .
}
Elseif ($2 != $Null) {
If ($Readini(iBot.ini, $Nick, $2) != $Null) {
.Msg $Chan $Chr(91) $+ $2 $+ $Chr(93) $Readini(iBot.ini, $Nick, $2) $+ .
.Notice $Nick $Chr(91) $+ Dictionary Entry $2 Is not in my file $+ $Chr(93) $+ .
}
}
}
}
Elseif ($Readini(iBot.ini, $Nick, Level) == Mod) {
If ($1- == .Commands) {
.Notice $Nick $Chr(91) Command List for Mods $Chr(93)
/Timer 1 3 .Notice $Nick <+/-> <Op/Voice/Quiet/Ban> <NickName>
/Timer 1 6 .Notice $Nick .<Kick/Invite> <NickName or Ip>
/Timer 1 9 .Notice $Nick .Add <Joke/Fact/Quote> <Your Joke/Quote/Fact Here>
/Timer 1 12 .Notice $Nick .<Greet/Dictionary> <Add/Edit> <Your Greet/Dictionary Entry Here>
/Timer 1 15 .Notice $Nick .<Greet/Dictionary> <Del> <Name of Dictionary Entry/Leave blank for Greet>
}
Elseif ($1 == .Kick) { Kick $Chan $2- }
Elseif ($1 == .Invite) { Invite $2- $Chan }
Elseif ($1 == +) {
If ($2 == Op) { Mode $Chan +o $3- }
Elseif ($2 == Voice) { Mode $Chan +v $3- }
Elseif ($2 == Quiet) { Mode $Chan +q $3- }
Elseif ($2 == Ban) { Mode $Chan +b $3- }
}
Elseif ($1 == -) {
If ($2 == Op) { Mode $Chan -o $3- }
Elseif ($2 == Voice) { Mode $Chan -v $3- }
Elseif ($2 == Quiet) { Mode $Chan -q $3- }
Elseif ($2 == Ban) { Mode $Chan -b $3- }
}
Elseif ($1 == .Add) {
If ($2 == Joke) {
Write Jokes.txt $3- By: $Nick
.Notice $Nick $Chr(91) $+ Added Joke $+ $Chr(93) $3- By: $Nick $+ .
}
Elseif ($2 == Fact) {
Write Facts.txt $3- By: $Nick
.Notice $Nick $Chr(91) $+ Added Fact $+ $Chr(93) $3- By: $Nick $+ .
}
Elseif ($2 == Quote) {
Write Quotes.txt $3- By: $Nick
.Notice $Nick $Chr(91) $+ Added Quote $+ $Chr(93) $3- By: $Nick $+ .
}
Elseif ($2 == $Null) {
.Notice $Nick You didn't select a catagory
.Notice $Nick Correct usage: .Add <Joke/Fact/Quote>
}
}
Elseif ($1 == .Quote) { .Msg $Chan $Read(Quotes.txt) }
Elseif ($1 == .Joke) { .Msg $Chan $Read(Jokes.txt) }
Elseif ($1 == .Fact) { .Msg $Chan $Read(Facts.txt) }
Elseif ($1 == .Greet) {
If ($2 == Add) {
Writeini iBot.ini $Nick Greet $3-
.Notice $Nick $Chr(91) $+ Added Greet $+ $Chr(93) $3- $+ .
}
Elseif ($2 == Del) {
Remini iBot.ini $Nick Greet
.Notice $Nick $Chr(91) $+ Deleted Greet $+ $Chr(93) For $Nick $+ .
}
Elseif ($2 == Edit) {
Remini iBot.ini $Nick Greet
Writeini iBot.ini $Nick Greet $3-
.Notice $Nick $Chr(91) $+ Edited Greet $+ $Chr(93) $3- $+ .
}
Elseif ($2 == $Null) {
.Msg $Chan $Chr(91) $+ $Nick $+ $Chr(93) $Readini(iBot.ini, $Nick, Greet)
}
}
Elseif ($1 == .Dictionary) {
If ($2 == Add) {
Writeini iBot.ini $Nick $3 $4-
.Notice $Nick $Chr(91) $+ Added Dictionary Entry $+ $Chr(93) $3 $+ : $4- $+ .
}
Elseif ($2 == Del) {
Remini iBot.ini $Nick $3
.Notice $Nick $Chr(91) $+ Deleted Dictionary Entry $+ $Chr(93) $3 $+ .
}
Elseif ($2 == Edit) {
Remini iBot.ini $Nick $3
Writeini iBot.ini $Nick $3 $4-
.Notice $Nick $Chr(91) $+ Edited Dictionary Entry $+ $Chr(93) $3 $+ : $4- $+ .
}
Elseif ($2 != $Null) {
If ($Readini(iBot.ini, $Nick, $2) != $Null) {
.Msg $Chan $Chr(91) $+ $2 $+ $Chr(93) $Readini(iBot.ini, $Nick, $2) $+ .
.Notice $Nick $Chr(91) $+ Dictionary Entry $2 Is not in my file $+ $Chr(93) $+ .
}
}
}
}
Elseif ($Readini(iBot.ini, $Nick, Level) == Voice) {
If ($1- == .Commands) {
.Notice $Nick $Chr(91) Command List for Voiced $Chr(93)
/Timer 1 3 .Notice $Nick <+/-> <Quiet> <NickName>
/Timer 1 6 .Notice $Nick .Add <Joke/Fact/Quote> <Your Joke/Quote/Fact Here>
/Timer 1 9 .Notice $Nick .<Greet/Dictionary> <Add/Edit> <Your Greet/Dictionary Entry Here>
/Timer 1 12 .Notice $Nick .<Greet/Dictionary> <Del> <Name of Dictionary Entry/Leave blank for Greet>
}
Elseif ($1 == +) {
If ($2 == Quiet) { Mode $Chan +q $3- }
}
Elseif ($1 == -) {
If ($2 == Quiet) { Mode $Chan -q $3- }
}
Elseif ($1 == .Add) {
If ($2 == Joke) {
Write Jokes.txt $3- By: $Nick
.Notice $Nick $Chr(91) $+ Added Joke $+ $Chr(93) $3- By: $Nick $+ .
}
Elseif ($2 == Fact) {
Write Facts.txt $3- By: $Nick
.Notice $Nick $Chr(91) $+ Added Fact $+ $Chr(93) $3- By: $Nick $+ .
}
Elseif ($2 == Quote) {
Write Quotes.txt $3- By: $Nick
.Notice $Nick $Chr(91) $+ Added Quote $+ $Chr(93) $3- By: $Nick $+ .
}
Elseif ($2 == $Null) {
.Notice $Nick You didn't select a catagory
.Notice $Nick Correct usage: .Add <Joke/Fact/Quote>
}
}
Elseif ($1 == .Quote) { .Msg $Chan $Read(Quotes.txt) }
Elseif ($1 == .Joke) { .Msg $Chan $Read(Jokes.txt) }
Elseif ($1 == .Fact) { .Msg $Chan $Read(Facts.txt) }
Elseif ($1 == .Greet) {
If ($2 == Add) {
Writeini iBot.ini $Nick Greet $3-
.Notice $Nick $Chr(91) $+ Added Greet $+ $Chr(93) $3- $+ .
}
Elseif ($2 == Del) {
Remini iBot.ini $Nick Greet
.Notice $Nick $Chr(91) $+ Deleted Greet $+ $Chr(93) For $Nick $+ .
}
Elseif ($2 == Edit) {
Remini iBot.ini $Nick Greet
Writeini iBot.ini $Nick Greet $3-
.Notice $Nick $Chr(91) $+ Edited Greet $+ $Chr(93) $3- $+ .
}
Elseif ($2 == $Null) {
.Msg $Chan $Chr(91) $+ $Nick $+ $Chr(93) $Readini(iBot.ini, $Nick, Greet)
}
}
Elseif ($1 == .Dictionary) {
If ($2 == Add) {
Writeini iBot.ini $Nick $3 $4-
.Notice $Nick $Chr(91) $+ Added Dictionary Entry $+ $Chr(93) $3 $+ : $4- $+ .
}
Elseif ($2 == Del) {
Remini iBot.ini $Nick $3
.Notice $Nick $Chr(91) $+ Deleted Dictionary Entry $+ $Chr(93) $3 $+ .
}
Elseif ($2 == Edit) {
Remini iBot.ini $Nick $3
Writeini iBot.ini $Nick $3 $4-
.Notice $Nick $Chr(91) $+ Edited Dictionary Entry $+ $Chr(93) $3 $+ : $4- $+ .
}
Elseif ($2 != $Null) {
If ($Readini(iBot.ini, $Nick, $2) != $Null) {
.Msg $Chan $Chr(91) $+ $2 $+ $Chr(93) $Readini(iBot.ini, $Nick, $2) $+ .
.Notice $Nick $Chr(91) $+ Dictionary Entry $2 Is not in my file $+ $Chr(93) $+ .
}
}
}
}
Elseif ($Readini(iBot.ini, $Nick, Level) == $Null) {
If ($Readini(iBot.ini, $Nick, Admin) == $Null) {
If ($1- == .Commands) {
.Notice $Nick $Chr(91) Command List for Voiced $Chr(93)
/Timer 1 3 .Notice $Nick .Add <Joke/Fact/Quote> <Your Joke/Quote/Fact Here>
/Timer 1 6 .Notice $Nick .<Greet/Dictionary> <Add/Edit> <Your Greet/Dictionary Entry Here>
/Timer 1 9 .Notice $Nick .<Greet/Dictionary> <Del> <Name of Dictionary Entry/Leave blank for Greet>
}
Elseif ($1 == +) {
If ($2 == Quiet) { Mode $Chan +q $3- }
}
Elseif ($1 == -) {
If ($2 == Quiet) { Mode $Chan -q $3- }
}
Elseif ($1 == .Add) {
If ($2 == Joke) {
Write Jokes.txt $3- By: $Nick
.Notice $Nick $Chr(91) $+ Added Joke $+ $Chr(93) $3- By: $Nick $+ .
}
Elseif ($2 == Fact) {
Write Facts.txt $3- By: $Nick
.Notice $Nick $Chr(91) $+ Added Fact $+ $Chr(93) $3- By: $Nick $+ .
}
Elseif ($2 == Quote) {
Write Quotes.txt $3- By: $Nick
.Notice $Nick $Chr(91) $+ Added Quote $+ $Chr(93) $3- By: $Nick $+ .
}
Elseif ($2 == $Null) {
.Notice $Nick You didn't select a catagory
.Notice $Nick Correct usage: .Add <Joke/Fact/Quote>
}
}
Elseif ($1 == .Quote) { .Msg $Chan $Read(Quotes.txt) }
Elseif ($1 == .Joke) { .Msg $Chan $Read(Jokes.txt) }
Elseif ($1 == .Fact) { .Msg $Chan $Read(Facts.txt) }
Elseif ($1 == .Greet) {
If ($2 == Add) {
Writeini iBot.ini $Nick Greet $3-
.Notice $Nick $Chr(91) $+ Added Greet $+ $Chr(93) $3- $+ .
}
Elseif ($2 == Del) {
Remini iBot.ini $Nick Greet
.Notice $Nick $Chr(91) $+ Deleted Greet $+ $Chr(93) For $Nick $+ .
}
Elseif ($2 == Edit) {
Remini iBot.ini $Nick Greet
Writeini iBot.ini $Nick Greet $3-
.Notice $Nick $Chr(91) $+ Edited Greet $+ $Chr(93) $3- $+ .
}
Elseif ($2 == $Null) {
.Msg $Chan $Chr(91) $+ $Nick $+ $Chr(93) $Readini(iBot.ini, $Nick, Greet)
}
}
Elseif ($1 == .Dictionary) {
If ($2 == Add) {
Writeini iBot.ini $Nick $3 $4-
.Notice $Nick $Chr(91) $+ Added Dictionary Entry $+ $Chr(93) $3 $+ : $4- $+ .
}
Elseif ($2 == Del) {
Remini iBot.ini $Nick $3
.Notice $Nick $Chr(91) $+ Deleted Dictionary Entry $+ $Chr(93) $3 $+ .
}
Elseif ($2 == Edit) {
Remini iBot.ini $Nick $3
Writeini iBot.ini $Nick $3 $4-
.Notice $Nick $Chr(91) $+ Edited Dictionary Entry $+ $Chr(93) $3 $+ : $4- $+ .
}
Elseif ($2 != $Null) {
If ($Readini(iBot.ini, $Nick, $2) != $Null) {
.Msg $Chan $Chr(91) $+ $2 $+ $Chr(93) $Readini(iBot.ini, $Nick, $2) $+ .
}
}
}
}
}
}
On *:Join:#: {
If ($Readini(iBot.ini, $Nick, Admin) == Yes) {
If ($Readini(iBot.ini, $Nick, Greet) != $Null) {
.Msg $Chan $Chr(91) $+ Auto Greet $+ $Chr(93) $Readini(iBot.ini, $Nick, Greet)
Mode $Chan +o $nick
}
Else { Mode $Chan +o $nick }
}
Elseif ($Readini(iBot.ini, $Nick, Level) == Mod) {
If ($Readini(iBot.ini, $Nick, Greet) != $Null) {
.Msg $Chan $Chr(91) $+ Auto Greet $+ $Chr(93) $Readini(iBot.ini, $Nick, Greet)
Mode $Chan +o $nick
}
Else { Mode $Chan +o $nick }
}
Elseif ($Readini(iBot.ini, $Nick, Level) == Voice) {
If ($Readini(iBot.ini, $Nick, Greet) != $Null) {
.Msg $Chan $Chr(91) $+ Auto Greet $+ $Chr(93) $Readini(iBot.ini, $Nick, Greet)
Mode $Chan +v $nick
}
Else { Mode $Chan +v $nick }
}
Else {
If ($Readini(iBot.ini, $Nick, Greet) != $Null) { .Msg $Chan $Chr(91) $+ Auto Greet $+ $Chr(93) $Readini(iBot.ini, $Nick, Greet) }
}
}
I read the help file on Hash Tables, but I would probably understand better, if I had a code that used Hash Tables. However I looked in the snippet section and only found Hash Table viewers. And I don\'t think those will make the cut.
If anyone has any kind of code that uses Hash Tables, other then viewers, would you please pm me it.
Hash tables have one big disadvantage to me: you have to hsave them. That means, if mIRC crashes you will loose all your data. A small disadvantage is that you cannot change the contents easily unless you have some kind of editor. About speed and INI: if your PC dates from 1990 or so, yes you should use hash tables. But modern PC\'s process INI files fast enough. By the way: INI files are processed in memory! Re: /help /flushini
Ive only just Started learnin how to code hash tables
its not overly hard
but im still on basic stuff
ini files are good if you dont no how to code hash tables
Good job :)
one suggestion
maybe make an on load thing So that you dont have to Create iBot.ini
?
So when you load the script into mirc it Writes the ini or some thin like that :)