I originally made this specifically for the WyldRyde network, it works with their Botserv. It would probably work on other networks with Botserv as well. It's part of the script I'm building optimized for the WyldRyde network. =]
It's fairly simple to use, just add your channel(s) and choose a channel to operate Botserv on. Whichever channel you have selected, determines what channel the rest of the dialog operates on. You can list all the bots available, type in the name of the bot you want, and click assign, and it'll assign the bot to your channel. You can make the bot say something by using the bot talk section, and make the bot do something by using the bot act section. I also put in a confirm delete dialog for deleting channels.
I'll be adding stuff to it, I just finished this first version after working with it for a while and making changes to it.
Thanks to Kirby for helping with the drop down menu. =]
dialog BSD {
title "Max's Botserv Dialog"
size -1 -1 192 106
option dbu
box "Assign/Unassign Bot", 1, 8 7 85 38
edit "", 2, 22 17 58 10
button "Assign", 3, 16 30 32 9
button "Unassign", 4, 51 30 32 9
box "Bot Channel", 5, 8 46 85 35
button "Add Channel", 7, 13 68 34 9
button "Close", 8, 101 88 21 9, ok cancel
button "List Bots", 9, 63 88 27 9
box "Make The Bot Talk", 10, 97 7 88 38
edit "", 11, 102 17 77 10, autohs
button "Bot Say", 12, 123 30 32 9
box "Make The Bot Do Something", 13, 97 46 88 35
edit "", 14, 102 56 77 10, autohs
button "Bot Act", 15, 123 68 32 9
button "Del Channel", 16, 49 68 36 9
combo 6, 18 55 63 50, size drop
}
on *:DIALOG:BSD:init:*:{
didtok $dname 6 44 %BChannels
did -c $dname 6 1
}
on *:dialog:BSD:sclick:*: {
if ($did == 3) { /botserv assign $did(BSD,6).text $did(BSD,2) }
if ($did == 4) { /botserv unassign $did(BSD,6).text }
if ($did == 7) { set %BChannels $addtok(%BChannels,$?="Enter a channel to add.",44) }
if ($did == 16) { set %BChannels $remtok(%BChannels,$did(6).seltext,1,44) }
if ($did == 9) { /botserv botlist }
if ($did == 12) { /botserv say $did(BSD,6).text $did(BSD,11) | did -r BSD 11 }
if ($did == 15) { /botserv act $did(BSD,6).text $did(BSD,14) | did -r BSD 14 }
}
looks nice and i might point out a first for me to se a dialouge made to access it..
now.. in saying that, botserv has much much more functions though than you have listed.
this is a complete list of botserv functions. you may for an upgrade to this code want to include some of these into the dialouge :)
-BotServ- BotServ allows you to have a bot on your own channel.
-BotServ- It has been created for users that can't host or
-BotServ- configure a bot, or for use on networks that don't
-BotServ- allow users' bot. Available commands are listed
-BotServ- below; to use them, type /msg BotServ command. For
-BotServ- more information on a specific command, type /msg
-BotServ- BotServ HELP command.
-BotServ- BOTLIST Lists available bots
-BotServ- ASSIGN Assigns a bot to a channel
-BotServ- SET Configures bot options
-BotServ- KICK Configures kickers
-BotServ- BADWORDS Maintains bad words list
-BotServ- ACT Makes the bot do the equivalent of a "/me" command
-BotServ- INFO Allows you to see BotServ information about a channel or a bot
-BotServ- SAY Makes the bot say the given text on the given channel
-BotServ- UNASSIGN Unassigns a bot from a channel -BotServ- Bot will join a channel whenever there is at least
-BotServ- 1user(s) on it.
gets a 7 from me so far as it stands due to its uniqueness
Along with what Slickone has said about using tokens, instead of .ini files, you can also change:
if ($did == 7) { writeini BChannels.ini Channels $calc($ini(BChannels.ini,Channels,0) + 1) $?="Enter Channel To Add" }
to
if ($did == 7) { set %BChannels $addtok(%BChannels,$?="Enter a channel to add.",44) }
I see that this is the complete snippet that you had a question about how to use .ini files, in the mIRC Forum. You could've used variables instead. :-P
Looks nice, you're getting better at dialogs.
One thing I would change though:
dialog Confirm {
title "Confirm Delete"
size -1 -1 84 36
option dbu
box "Delete Channel?", 1, 3 1 78 33
button "Yes", 2, 10 16 29 9, ok
button "No", 3, 44 16 29 9, cancel
}
Instead of a separate dialog, you can use an $input event to handle that.
In this script, however, I would use something like:
noop $input(Delete Channel?,ywk5,Confirm Delete)
/noop means no operation, if you didn't know.
To further modify this, you can do something like:
$iif($input(Delete Channel?,ywk5,Confirm Delete),remini BChannels.ini Channels $did(BSD,6).sel)
/help $input for more information on how to use them.