Author |
Message |
Maverick

Age:40 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
Posted: Sat Feb 26, 2005 2:01 pm Post subject: Mervbot c->final |
 |
|
|
|
Hiya Guys,
Got a simple question concering Mervbot:
When a player does '!command parameter'; How can I get the full command and parameter in a String?
I am trying to do that now because I have a command that concerns giving a squad for a parameter. So if the operator does !command -=SMG=- Mervbot sees that as a switch and then c->final is empty
Someone already had this problem or does someone know the solution to this? |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Sat Feb 26, 2005 2:27 pm Post subject: |
 |
|
|
|
It "thinks" that "-=SMG=-" is a switch?
Hah, sounds like a command parsing "bug" to me.
A nasty, quick solution may be adding an extra characters to it, like quotes next to the squadname.
Otherwise you could edit the core and add some variable which contains the whole line after the command or get rid of switches. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sat Feb 26, 2005 2:47 pm Post subject: |
 |
|
|
|
Just don't design command stuff starting with the '-' character. I can't see any situation in which it would be necessary. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Sat Feb 26, 2005 3:08 pm Post subject: |
 |
|
|
|
He wants a parameter to be able to start with '-', since the parameter of his command is supposed to have a squadname as the parameter.
So, if a squadname starts with a '-' he's screwed since MERV parses it as a switch. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sun Feb 27, 2005 12:36 am Post subject: |
 |
|
|
|
Oh, duh. Sorry, I guess I didn't read too clearly.
You could just have them put the squad name in quotes. It's kinda hard to make a very reliable command system to recognize what's a switch and what's raw input, and Catid's command processing code kinda sucks. Maybe I'll rewrite it some day for him. Some day. |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Sun Feb 27, 2005 4:00 am Post subject: |
 |
|
|
|
Mervbot core should handle all command functions, similar to the way ASSS does. Have the dll register commands with the core and have the core store a pointer to a specific function in the dll that should be run when the command is sent to the bot. Registering !commands with the core will allow for the core to display a nicely formated !help menu. You can take a look at a powerbot in EG or PB, they register commands with the core and it makes it easier to read commands and understand them.
Switches are useless, they should be taken out entirely or made into a seperate function. |
|
Back to top |
|
 |
Maverick

Age:40 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
Posted: Sun Feb 27, 2005 4:41 am Post subject: |
 |
|
|
|
hmm ok.. quotes it is then.
I suppose it also isn't possible to somehow use the switch to get the full parameter anyway?
(first I thought that Mervbot was wow and way to go but that feeling is getting lesser and lesser while making advanced bots ) |
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Sun Feb 27, 2005 5:41 am Post subject: |
 |
|
|
|
Maverick wrote: | I suppose it also isn't possible to somehow use the switch to get the full parameter anyway? |
It probably is.
On the league bot, in the zone I was staff in, we used -a= -b= switches to set the squadnames.
In a log I just saw that a player set the squadnames to "-a" and "-b", which means that the actual switch parameters can start with a '-'.
So, in your case "!command -p=-=SMG=-" might work, if not, use the quotes or hack the core.  |
|
Back to top |
|
 |
Maverick

Age:40 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
Posted: Sun Feb 27, 2005 6:35 am Post subject: |
 |
|
|
|
ok
 |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Sun Feb 27, 2005 9:30 am Post subject: |
 |
|
|
|
From what I've seen, the bots all have most things in common and just differ in what "fancy things" they have (thanks 50% ). Probably the biggest difference between the 3 main cores is the language they are written in. I'd be writing stuff in asss, but I can't get stupid grub to work  |
|
Back to top |
|
 |
|