Official Everybody Edits Forums

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.

#1 2017-08-27 19:26:47

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

"write"'s gayness

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

#2 2017-08-27 20:08:12, last edited by LukeM (2017-08-27 20:09:10)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: "write"'s gayness

Swarth100 wrote:

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

Wooted by:

#3 2017-08-27 20:11:47

Tomahawk
Forum Mod
From: UK
Joined: 2015-02-18
Posts: 2,824

Re: "write"'s gayness

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

Wooted by: (4)

#4 2017-08-27 20:14:38

Swarth100
Member
Joined: 2015-07-18
Posts: 305

Re: "write"'s gayness

destroyer123 wrote:
Swarth100 wrote:

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 );

Ahahah
I figured that ninja was worried about "write" commands and I answered regarding "say" //forums.everybodyedits.com/img/smilies/tongue

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

Wooted by:

#5 2017-08-27 21:23:00

realmaster42
Formerly marcoantonimsantos
From: ̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍̍
Joined: 2015-02-20
Posts: 1,380
Website

Re: "write"'s gayness

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(":"));

http://i.imgur.com/bjvgH5L.png?1

Offline

#6 2017-08-27 22:45:17

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

Re: "write"'s gayness

marcoantonimsantos wrote:

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(":"));
ninjasupeatsninja wrote:

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

...

and yes, EE sends you "* YOU > PLAYER: msg", it's not client side as you'd expect.

Offline

#7 2017-08-27 23:16:40

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: "write"'s gayness

Slightly off-topic:

destroyer123 wrote:

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

#8 2017-08-28 03:27:51

italkalotfromee
Member
Joined: 2015-05-08
Posts: 117

Re: "write"'s gayness

            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


FluxBB bbcode test

Offline

Wooted by:

#9 2017-08-28 04:42:05

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

Re: "write"'s gayness

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

#10 2017-08-28 04:57:28

italkalotfromee
Member
Joined: 2015-05-08
Posts: 117

Re: "write"'s gayness

ninjasupeatsninja wrote:

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.


FluxBB bbcode test

Offline

Wooted by:
italkalotfromee1503892648675209

Board footer

Powered by FluxBB

[ Started around 1711723444.8007 - Generated in 0.126 seconds, 10 queries executed - Memory usage: 1.54 MiB (Peak: 1.71 MiB) ]