Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
Pages: 1
can we change write
i hate having to deal with PMs
string 0 could be:
"* NOOB > YOU"
"* YOU > NOOB"
"* SYSTEM"
"* WORLD"
"* MAGIC"
and string 2 is the chat message can we have it like
0: int
1: string
2: string
int 0:
0 - from the system
1 - from a player
2 - you're sending it to someone
string 1: the name of the player that you're recieving it from, or SYSTEM, e.t.c
string 2: message
i dont have the best solution currently, but it's super weird currently and not very nice to deal wit hat all..
and yes, EE sends you "* YOU > PLAYER: msg", it's not client side as you'd expect.
Offline
This is just an overcomplicated example from a very old bot.
▼Trigger over-engineered code waring
You call that overcomplicated???
I once had a 150+ line mess of code that queued messages (had seperate queues for each players PMs, global chat, commands etc), split messages at convenient points (it would split it trying to keep the messages as long as possible, but also not cut at confusing places, e.g. in the middle of words, or sometimes list items), auto generate a load of commands, etc.
Edit: seems they deleted it, but ill this here because I put time into it );
Offline
You only have to write the parsing function once. It's not that hard.
One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.
Offline
Swarth100 wrote:This is just an overcomplicated example from a very old bot.
▼Trigger over-engineered code waringYou call that overcomplicated???
I once had a 150+ line mess of code that queued messages (had seperate queues for each players PMs, global chat, commands etc), split messages at convenient points (it would split it trying to keep the messages as long as possible, but also not cut at confusing places, e.g. in the middle of words, or sometimes list items), auto generate a load of commands, etc.
Edit: seems they deleted it, but ill this here because I put time into it );
Ahahah
I figured that ninja was worried about "write" commands and I answered regarding "say"
I personally consider over complicated code anything that isn't modular nor scaleable, and back in the day I had none of the two in mind XD
Offline
But, this is not how "write" works.
"write" is used in much more things than you think.
Every time you get a "* SYSTEM" message it's "write".
A "* WORLD" message is "write".
And sometimes, some other words are "write"...
"write" is good as it is, and parsing PMs is of the easiest things to do...
string msg = pm.Substring(pm.IndexOf(":"));
Offline
But, this is not how "write" works.
"write" is used in much more things than you think.
Every time you get a "* SYSTEM" message it's "write".
A "* WORLD" message is "write".And sometimes, some other words are "write"...
"write" is good as it is, and parsing PMs is of the easiest things to do...string msg = pm.Substring(pm.IndexOf(":"));
...can we have it like
0: int
1: string
2: stringint 0:
0 - from the system
1 - from a player
2 - you're sending it to someone...
and yes, EE sends you "* YOU > PLAYER: msg", it's not client side as you'd expect.
Offline
Slightly off-topic:
I once had a 150+ line mess of code that queued messages (had seperate queues for each players PMs, global chat, commands etc), split messages at convenient points (it would split it trying to keep the messages as long as possible, but also not cut at confusing places, e.g. in the middle of words, or sometimes list items), auto generate a load of commands, etc.
Glad to know I'm not the only one who did that... I kinda had a single class though, and I just made an object for PMs, an object for global, etc.
Offline
if (m.Type == "write")
{
string user = m.GetString(0).Split(' ')[1];
string[] msg = m.GetString(1).Split(' ');
if (msg[0] == "help")
{
Bot.pmUser(user, "Commands go here");
}
}
This worked for me. Very simple for a crappy programmer as some people see me. xD
Offline
but guys what if a player's name is YOU.
and he pms a perosn
YOU > YOU
auto bot inferences will be made if the bot pms someone and ugly stuff all around
there are underlying foundational problems here
Offline
but guys what if a player's name is YOU.
and he pms a perosn
YOU > YOU
auto bot inferences will be made if the bot pms someone and ugly stuff all around
there are underlying foundational problems here
With the method I use you won't have that problem, but i can see what you're getting at.
Offline
Pages: 1
[ Started around 1732959890.9824 - Generated in 0.049 seconds, 19 queries executed - Memory usage: 1.55 MiB (Peak: 1.73 MiB) ]