Top

Max's Botserv Dialog


mIRC Code
+ 1 likes
Please Register to submit score.
Bookmark and Share
Average Score  7.0 (of 3 scores)
Date Added  May 08, 2009
Last Updated  May 13, 2009
Tags  bot  bots  botserv  commands  dialog 

Introduction



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. =]

Grab the Code

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 }
}

Comments

  (12)  RSS
Aucun50
Comments: 548
 
mIRC Snippet:  Max's Botserv Dialog
Posted on May 9, 2009 12:02 am
I like this simple but useful, the coding is great as well.

I think you could have made the dialog look a bit better some of the buttons are a little to small for the words inside them.
Kirby
Comments: 475
 
mIRC Snippet:  Max's Botserv Dialog
Posted on May 9, 2009 7:58 pm
Looks nice, you're getting better at dialogs.

One thing I would change though:
Code:
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:
Code:
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:
Code:
$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.
Slickone
Comments: 10
 
mIRC Snippet:  Max's Botserv Dialog
Posted on May 9, 2009 8:06 pm
instead of useing BChannels.ini for the channels just use a var ex: %BChannels #chan1,#chan2,#chan3 also after that get rid of that ChannelBox alias then use this on the init event
Code:
didtok $dname 6 44 %BChannels

/help /didtok
Kirby
Comments: 475
 
mIRC Snippet:  Max's Botserv Dialog
Posted on May 9, 2009 8:15 pm
Along with what Slickone has said about using tokens, instead of .ini files, you can also change:
Code:
  if ($did == 7) { writeini BChannels.ini Channels $calc($ini(BChannels.ini,Channels,0) + 1) $?="Enter Channel To Add" }

to
Code:
  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
MaxEvans
Comments: 89
 
mIRC Snippet:  Max's Botserv Dialog
Posted on May 9, 2009 8:36 pm
I remembered I had used ini files before. But didn't think about using variables for it. So, that is a good idea. =P
Cheiron
Comments: 627
 
mIRC Snippet:  Max's Botserv Dialog
Posted on May 9, 2009 9:00 pm
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 :)

Quote:

-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
MaxEvans
Comments: 89
 
mIRC Snippet:  Max's Botserv Dialog
Posted on May 9, 2009 9:20 pm
Yeah, I'll add a lot more to the dialog. I added basic commands for now.
MaxEvans
Comments: 89
 
mIRC Snippet:  Max's Botserv Dialog
Posted on May 11, 2009 10:56 pm
What would I use to delete tokens? I tried $deltok, but I must be missing something.
Cheiron
Comments: 627
 
mIRC Snippet:  Max's Botserv Dialog
Posted on May 13, 2009 8:26 am
i had a look at mirc help files for deltok and this is all i could see
Quote:

$deltok(text,N-N2,C)

Deletes the Nth token from text.



$deltok(a.b.c.d,3,46) returns a.b.d

$deltok(a.b.c.d,2-3,46) returns a.d



You can specify a negative value for N.

MaxEvans
Comments: 89
 
mIRC Snippet:  Max's Botserv Dialog
Posted on May 13, 2009 12:45 pm
I tried

Code:
$deltok(%BChannels,$did(BSD,6).text,44)


But that didn't work. So, I'm wondering if I missed something. Or didn't do it right.
napa182
Comments: 1,455
 
mIRC Snippet:  Max's Botserv Dialog
Posted on May 13, 2009 1:12 pm
try this
Code:
$deltok(%BChannels,$did(6).sel,44)

or this
Code:
$remtok(%BChannels,$did(6).seltext,1,44)
MaxEvans
Comments: 89
 
mIRC Snippet:  Max's Botserv Dialog
Posted on May 13, 2009 1:22 pm
Thank you! That worked.

Now if I wanted to put

Code:
$iif($input(Delete Channel?,ywk5,Confirm Delete)


I put that in there and it said invalid format.

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom