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.

Donate!

pls donate


#1 2016-10-13 10:57:57, last edited by 1448 (2017-05-26 11:46:07)

1448
Formerly alkazam1448
From: Numberland
Joined: 2015-04-12
Posts: 679
Website

[Release] Bot1448 v2.1.0 - UPDATE FIX

Bot1448 v2.1.0!

v2.1.0 focuses mainly on improvements to the auto-updater. Oh, and it's completely open-source (available under the MIT license) now! //forums.everybodyedits.com/img/smilies/big_smile

Screenshots
Features
Changelog
Bugs? Suggestions?

Please post them here! It would be really helpful if you do.

Download here!

Offline

Wooted by:

#2 2016-10-13 11:10:51, last edited by Koya (2016-10-13 11:20:53)

Koya
Fabulous Design Team
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,287

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

Just have to point out the file storage because you pointed it out, why bother with binary when the only benefit is speed when the only things that are written are infrequent things and most of the data is stored in memory without the need to read or write. Also, as you mentioned XML I don't think you have used the holy grail of general data storage of the JSON file.

The reports and comments does sound interesting and will be used for bullying in a few circumstances.


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#3 2016-10-13 11:19:14, last edited by 1448 (2016-10-13 12:04:06)

1448
Formerly alkazam1448
From: Numberland
Joined: 2015-04-12
Posts: 679
Website

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

Koya wrote:

The reports and comments does sound interesting and will be used for bulling in a few circumstances.

I don't understand what "bulling" means. I assume it is a typo for "bullying".

Yes. The report system may be used for bullying. I understand. That's why I added the number of reports for a ban option, and I set it to 5 as default.

If bulling means "speaking bulls***", then the 1 comment per person limitation will take care of that. The owner of the bot can also remove comments if he wants, through the GUI. The same is true for reports. I can report you only once if I wanted to. The owner can also remove reports.

EDIT:

Koya wrote:

(below)

Oh lol well anyways I think I answered that.

Offline

#4 2016-10-13 11:20:45

Koya
Fabulous Design Team
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,287

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

Whoops, I did mean bullying and nothing else.


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#5 2016-10-13 13:11:45, last edited by capasha (2016-10-13 13:16:31)

capasha
Member
Joined: 2015-02-21
Posts: 3,802

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

Saving settings would be best to use JSON. I really like JSON now. And it's easy to read too.
I don't know why binary would be best. What if you want to edit an setting in the document when it's binary? I mean in notepad.

Instead of using this:

if (e.GetString(1u).StartsWith("!") || e.GetString(1u).StartsWith(".") || e.GetString(1u).StartsWith("@"))
{

You could use regex, which is better and easier.

if (Regex.IsMatch(line.Substring(0, 1), @".|,|-|_|!|\&|%|\?"))
{

Then can people use . , - _ & ! % ? as first letter.

You could also use something like this if you want to use !help x

Offline

Wooted by:

#6 2016-10-13 13:30:03, last edited by Koya (2016-10-13 15:56:59)

Koya
Fabulous Design Team
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,287

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

Careful, "." in regex means any non-breaking character, and make it search only the beginning of the string.

You want this:

[\.,\-_!&%?]

____

How I would do it:

(match the whole incoming text for ease and you can use the match to filter off commands)

Regex.IsMatch(line, regex)

Valid command format:

^[\.,\-_!&%?][A-Za-z]+\b

For overkill, if you want to allow anyone to use whatever punctuation as a prefix:

^[^a-zA-Z0-9][A-Za-z]+\b

Extending this you could match other variables in a neat manner

^[^a-zA-Z0-9]([A-Za-z])+\b( [A-Za-z0-9]+)*
Match m = Regex.Match(line, @"^[^a-zA-Z0-9]([A-Za-z])+\b( [A-Za-z0-9]+)*)");
if(m.Success)
{
    string command = m.Groups[0].Value; //This doesn't include whatever prefix was used.
    string var1 = m.Groups[1].Value;
    string var2 = m.Groups[2].Value;
    //...
}

Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#7 2016-10-13 13:31:35

capasha
Member
Joined: 2015-02-21
Posts: 3,802

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

Koya wrote:

Careful, "." in regex means any non-breaking character

You want this:

^[\.|,|-|_|!|\&|%|\?]

I guess I forgot to add \ to .

Offline

#8 2016-10-13 15:40:42, last edited by den3107 (2016-10-13 15:48:44)

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 999

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

Or you just make it

^[.,-_!&%?]

All chars between [] are automatically escaped.
Besides, I think you meant to use () instead of [].

Offline

Wooted by:

#9 2016-10-13 15:44:23, last edited by Koya (2016-10-13 15:45:48)

Koya
Fabulous Design Team
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,287

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

den3107 wrote:

Or you just make it

[^.,-_!&%?]

All chars between [] are automatically escaped.
Besides, I think you meant to use () instead of [].

*deep sigh* good point, makes no sense to have [|]; I blame C&Ping capasha //forums.everybodyedits.com/img/smilies/tongue
Still need to put the start outside and escape . and - though

^[\.,\-_!&%?]

Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#10 2016-10-13 15:49:48

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 999

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

Koya wrote:

Still need to put the start outside and escape . and - though

Yeah, edited it, for some reason I thought you meant to use negative (instead of start of string).

Offline

#11 2016-10-13 15:52:37

Koya
Fabulous Design Team
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,287

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

den3107 wrote:
Koya wrote:

Still need to put the start outside and escape . and - though

Yeah, edited it, for some reason I thought you meant to use negative (instead of start of string).

I'm matching the whole chat message while capasha is matching the first char.

Extended overkill ftw!


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#12 2016-10-13 15:58:41

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 1,994
Website

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

This whole regex thing seems confusing but amazing...
Could anybody give me 1448 a link to a guide using regex?
I think we all need to start using this instead of StartsWith

Offline

#13 2016-10-13 16:15:21, last edited by Koya (2016-10-13 17:26:32)

Koya
Fabulous Design Team
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,287

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

@OP - what other new features are you planning to add to this bot?

ninjasupeatsninja wrote:

This whole regex thing seems confusing but amazing...
Could anybody give me 1448 a link to a guide using regex?
I think we all need to start using this instead of StartsWith

Regex is super useful and would be a core programming skill (it's cross-language too - even in CSS).
StartsWith still has use for quick things though, which doing with regex will look messy.

I learnt through DDG searches but I found a resource that outlines things nicely @ and I use this site to text complex regex patterns @.


Edit: I am more than happy to help with regex patterns as they can get complex, message me on the forums #.


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#14 2016-10-13 16:36:52

Myst
Guest

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

best bot ever

Wooted by:

#15 2016-10-13 18:06:29

Tomahawk
Forum Mod
From: BiH
Joined: 2015-02-18
Posts: 2,127

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

You must be trolling with that regex. It's overkill for comparing the first char to 3 things and is probably more performance-intensive than 3 StartsWith()s - it's certainly much less readable.

I would leave your code how it was, but if you want to add more prefixes it will be easier to do:

if (new char[] { '!', '.', '@' }.Contains(m.GetString(1)[0]) { ... }

This creates a char array and fills it with the command prefixes you want. It then checks if the array contains the first character of the chat message, so if the chat message starts with a command prefix (! . @), the statement returns true.


One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.

Offline

#16 2016-10-13 18:12:14, last edited by Koya (2016-10-14 17:22:02)

Koya
Fabulous Design Team
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,287

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

Tomahawk wrote:

You must be trolling with that regex. It's overkill for comparing the first char to 3 things and is probably more performance-intensive than 3 StartsWith()s - it's certainly much less readable.

I would leave your code how it was, but if you want to add more prefixes it will be easier to do:

if (new char[] { '!', '.', '@' }.Contains(m.GetString(1)[0]) { ... }

This creates a char array and fills it with the command prefixes you want. It then checks if the array contains the first character of the chat message, so if the chat message starts with a command prefix (! . @), the statement returns true.

I did say it was overkill but the final one works perfectly for commands, accept any punctuation and with no effort I now have the command used alone without the punctuation, it's useful to be able to fully parse a command - may as well have the best solution early on.


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#17 2016-10-13 18:15:10

XxAtillaxX
Member
From: Canada
Joined: 2015-11-28
Posts: 3,974

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

Tomahawk wrote:

You must be trolling with that regex. It's overkill for comparing the first char to 3 things and is probably more performance-intensive than 3 StartsWith()s - it's certainly much less readable.

It's perfectly acceptable to use low-performance code in applicable scenarios, such as this, nor is it unreadable to anyone that knows regular expressions.


signature.png

Offline

#18 2016-10-13 22:53:10

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 999

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

Regex indeed is very intensive, mostly compiling them (or so I hear on work). In case you do want to use regex: Compile them beforehand (put them in a Regex object), and obviously don't do this compilation inside any loop, since then you'd compile them over and over again instead of just once. Compilation over regex' are very resource intensive (obviously using them too, but it'll only get significant when they're very complex or are applied on large portions of text).

Anyways, if you would want to micro-optamize but keep regex, I think this regex would be more efficient, mostly on the compile side: ^\W
Matches everything except ranges "a-z", "A-Z", "0-9" and the "_" character. If you'd want to also include "_" it'd simply be: ^(\W|_)

Would also increase readability to use \w instead of all those alphanumeric ranges, in my opinion. And I'd also use \s+ just in case somebody's an idiot and places multiple spaces...

Btw, Koya, why do you limit the user to just alphanumeric characters in their command messages? They can't even put a good-grammar "." and the end of a report message! D:

Offline

#19 2016-10-13 23:01:03

XxAtillaxX
Member
From: Canada
Joined: 2015-11-28
Posts: 3,974

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

It's completely nonsensical to get worked up over the performance costs of using regular expressions in this scenario, because it's utterly negligible.


signature.png

Offline

Wooted by:

#20 2016-10-14 17:22:20

Koya
Fabulous Design Team
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,287

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

den3107 wrote:

Regex indeed is very intensive, mostly compiling them (or so I hear on work). In case you do want to use regex: Compile them beforehand (put them in a Regex object), and obviously don't do this compilation inside any loop, since then you'd compile them over and over again instead of just once. Compilation over regex' are very resource intensive (obviously using them too, but it'll only get significant when they're very complex or are applied on large portions of text).

Anyways, if you would want to micro-optamize but keep regex, I think this regex would be more efficient, mostly on the compile side: ^\W
Matches everything except ranges "a-z", "A-Z", "0-9" and the "_" character. If you'd want to also include "_" it'd simply be: ^(\W|_)

Would also increase readability to use \w instead of all those alphanumeric ranges, in my opinion. And I'd also use \s+ just in case somebody's an idiot and places multiple spaces...

Btw, Koya, why do you limit the user to just alphanumeric characters in their command messages? They can't even put a good-grammar "." and the end of a report message! D:

Commands do not include numbers, anywhere; you can add them by all means.

I use Regex because with one variable I now have the command without the punctuation and all values in the message, it simplifies and keeps the code cleaner; this process is run for each command and not 10 times a second.


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#21 2016-10-14 22:16:25, last edited by den3107 (2016-10-14 22:17:59)

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 999

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

Koya wrote:

Commands do not include numbers, anywhere; you can add them by all means.

I was more pointing at the parameter part: ^[^a-zA-Z0-9]([A-Za-z])+\b( [A-Za-z0-9]+)*

So first off: Perhaps sometimes you would like to use numbers? I mean, can't hurt to implement the functionality.
Also, why the /b? the white space already takes care of that.

But yeah, currently the parameters wouldn't be very "message" friendly. For example the report feature: can't use "&" or "." or "!" or "(" etc.

So I'd personally use a regex like:
^(\W|_)\w+(\s+\S+)*)

EDIT: also thought of a bug with your current regex regarding special characters, but nevermind.

Offline

#22 2016-10-16 10:40:28

1448
Formerly alkazam1448
From: Numberland
Joined: 2015-04-12
Posts: 679
Website

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

OP wrote:

What new features are you going to add to this bot?

https://wiki.everybodyedits.com/images/c/c0/069_LOL I'll answer it anyways.

I'll try to add new features but I don't get time.
Right now, I'm not doing anything because I'm busy with other things.

When I do get time, I'll try to add a fill tool which lets you fill blocks in a rectangular area between 2 co-ordinates. And a digbot once I get my hands on Processor's deserialization tool.

GermanPower68 wrote:

best bot ever

Thanks //forums.everybodyedits.com/img/smilies/big_smile

XxAtillaxX wrote:

It's completely nonsensical to get worked up over the performance costs of using regular expressions in this scenario, because it's utterly negligible.

Not on the PC I use. I take more than 2 minutes to compile my code. I work on a potato.

Offline

#23 2016-10-16 13:53:39

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 999

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

1448 wrote:
XxAtillaxX wrote:

It's completely nonsensical to get worked up over the performance costs of using regular expressions in this scenario, because it's utterly negligible.

Not on the PC I use. I take more than 2 minutes to compile my code. I work on a potato.

We're talking about run-time optimizations //forums.everybodyedits.com/img/smilies/tongue
Beside the fact that it's very hard to optimize compilation time, it's way more important to focus on the run speed.

Offline

#24 2016-10-22 17:59:32

capasha
Member
Joined: 2015-02-21
Posts: 3,802

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

Sorry to bump this. But I was reading the readme and found this.

<For security nerds> Bot1448 doesn't collect any of your data. You can be a 100% safe when you use Bot1448.</For security nerds>

Still you save the email and password in settings.dat.

Offline

#25 2016-10-22 23:37:28

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 999

Re: [Release] Bot1448 v2.1.0 - UPDATE FIX

capasha wrote:

Sorry to bump this. But I was reading the readme and found this.

<For security nerds> Bot1448 doesn't collect any of your data. You can be a 100% safe when you use Bot1448.</For security nerds>

Still you save the email and password in settings.dat.

I think will collecting he meant something ninja once did with his bot. Actually mining data and putting it on HIS pc instead of the one of the user.
The bot is entirely safe to use when all data is saved locally. The person might be less safe when another person get access to said file.
Obviously encrypting the data would be BETER... But the bot is still doesn't do anything freaky with your data.

Offline

14481495880498661398

Board footer

Powered by FluxBB

[ Started around 1568680130.2714 - Generated in 0.164 seconds, 13 queries executed - Memory usage: 1.72 MiB (Peak: 2.03 MiB) ]