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.

#76 2015-11-02 00:04:58, last edited by hummerz5 (2015-11-02 01:44:47)

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,853

Re: [Tutorial] TUTORIALS

The real question is not "what is the alternative"

The question you should be asking is "why does it 'always doesn't work'?"

Era, I presume you know this; what compels you to set this random person up for failure? If they cannot (in essence) copy and paste code to make it work, what suggests a less-documented, no walkthrough method will work?

edit:
ok maybe the wording is a bit strong.
but he doesn't have much hope.

Offline

#77 2015-11-02 01:40:00

Era
Member
From: ::1
Joined: 2015-05-06
Posts: 884

Re: [Tutorial] TUTORIALS

Good point, and no setting him her up for a failure wasnt my intention.

Offline

Wooted by:

#78 2015-11-04 22:21:36

Real_Naa2001
Member
Joined: 2015-10-24
Posts: 16

Re: [Tutorial] TUTORIALS

I'm having a problem with the INI.cs in the wins video the problem is when you copy and paste it's saying The type or namespace name 'Dllmport' and 'DllmportAttribute' could not be found and now the wins command won't work... //forums.everybodyedits.com/img/smilies/neutral


SHUT AND LISTEN!!!

giphy.gif

Offline

#79 2015-11-05 01:08:26

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

Re: [Tutorial] TUTORIALS

I strongly suggest people to first learn how to do some basic C# in Visual Studio, since many basic questions pass by (which can also be easily googled since they're not really context-specific)

Offline

Wooted by:

#80 2015-11-05 03:11:02

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: [Tutorial] TUTORIALS

den3107 wrote:

I strongly suggest people to first learn how to do some basic C# in Visual Studio, since many basic questions pass by (which can also be easily googled since they're not really context-specific)

Also, they should google their problems. Not everything is related to EE


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

Wooted by:

#81 2015-11-05 12:50:34

shadowda
Member
From: somewhere probably.
Joined: 2015-02-19
Posts: 1,015

Re: [Tutorial] TUTORIALS

Xfrogman43 wrote:

Not everything is related to EE

du heck mean.
ee is life.

but in all honesty yea, goggle can be helpful but its hard to find all the right of information.


color = #1E1E1E       

latest?cb=20150604065609

Offline

#82 2015-11-05 19:01:11, last edited by capasha (2015-11-05 19:07:25)

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: [Tutorial] TUTORIALS

Real_Naa2001 wrote:

I'm having a problem with the INI.cs in the wins video the problem is when you copy and paste it's saying The type or namespace name 'Dllmport' and 'DllmportAttribute' could not be found and now the wins command won't work... //forums.everybodyedits.com/img/smilies/neutral

I don't know why he use INI files. Use XML, Json or text documents or MySQL.

Offline

Wooted by:

#83 2015-11-05 23:44:13

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,853

Re: [Tutorial] TUTORIALS

Such is why I suggested creating a wiki-style system
so we get these agreements in a document for all the noobs who have questions

Offline

#84 2015-11-06 00:45:07

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

Re: [Tutorial] TUTORIALS

hummerz5 wrote:

Such is why I suggested creating a wiki-style system
so we get these agreements in a document for all the noobs who have questions

And they would read these agreements because?
Really people just find something about making bots, following it to the letter but one, and instead of googling it themselves (being done in 5 min), they ask it on the forums (being done in 5 days if at all).

Offline

Wooted by:

#85 2015-11-08 23:41:55, last edited by Xfrogman43 (2015-11-08 23:43:04)

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: [Tutorial] TUTORIALS

Real_Naa2001 wrote:

For the wins video what's the code for making wining streak

Make a streak, and if they win, add +1 to the streak, if they lose, record that streak, and set it to 1 for the winning player


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#86 2015-11-08 23:42:55

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,853

Re: [Tutorial] TUTORIALS

Real_Naa2001 wrote:

For the wins video what's the code for making wining streak

easy. if they win again, they won again
IF they start winning oftener and oftener, then you tell them!

Offline

Wooted by:

#87 2015-11-14 21:43:59

Real_Naa2001
Member
Joined: 2015-10-24
Posts: 16

Re: [Tutorial] TUTORIALS

what do you put to see other people wins? Is it   if (string.Compare(command, "wins" + username) == 0)    because I already tried that and it doesn't work. I just want to know!


SHUT AND LISTEN!!!

giphy.gif

Offline

#88 2015-11-15 00:25:41

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: [Tutorial] TUTORIALS

Real_Naa2001 wrote:

what do you put to see other people wins? Is it   if (string.Compare(command, "wins" + username) == 0)    because I already tried that and it doesn't work. I just want to know!

Have you tried "wins " + username?
If you use "wins" + username, you need to write winsUsername

Offline

#89 2016-05-15 20:55:21, last edited by Latif (2016-05-15 21:19:23)

Latif
Member
From: The Netherlands
Joined: 2015-03-13
Posts: 1,206

Re: [Tutorial] TUTORIALS

Uhmm.. Tutorial 7 (make commands) is blocked.
Can someone give me the code. //forums.everybodyedits.com/img/smilies/smile please

(And no, I don't want BotBits)

Offline

#90 2016-05-15 22:07:29

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: [Tutorial] TUTORIALS

latif wrote:

Uhmm.. Tutorial 7 (make commands) is blocked.
Can someone give me the code. //forums.everybodyedits.com/img/smilies/smile please

(And no, I don't want BotBits)

case "say": //or if(m.GetType == "say")
{
     string msg = m.GetString(1);
     if(msg.StartsWith("!command"))
     {
           conn.Send("say", "hello");
     }
}
break;

zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#91 2016-05-15 22:24:45, last edited by capasha (2016-05-15 22:38:33)

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: [Tutorial] TUTORIALS

For which good reason was this added? "string msg = m.GetString(1);"
When you just can use m.GetString(1).StartsWith("!command")

Then if you want to add more words to the commands use:

string[] words = m.GetString(1).ToLower().Split(' '); //Which will split the words.
if (words[0].StartsWith("!kick")) //if the command contains !kick or !kickAnythingHere 
{

   if (words.Length == 2) //If there is two words, kick the guy
   {
      con.Send("say","/kick " + words[1] + " tsk tsk");
    }
}

Offline

#92 2016-05-15 22:32:45, last edited by Xfrogman43 (2016-05-15 22:33:04)

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: [Tutorial] TUTORIALS

capasha wrote:

For which good reason was this added? "string msg = m.GetString(1);"
When you just can use m.GetString(1).StartsWith("!command")

Obviously this guy isn't a good programmer, so I just made it easy instead of having to deal with arrays.


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#93 2016-05-15 22:33:02

AlphaJon
Member
From: Who knows
Joined: 2015-07-21
Posts: 1,297

Re: [Tutorial] TUTORIALS

capasha wrote:

For which good reason was this added? "string msg = m.GetString(1);"
When you just can use m.GetString(1).StartsWith("!command")

Readability, I guess. message.StartsWith("stuff") is easier to read than m.GetString(1).StartsWith("stuff"), while avoiding having m.GetString(1) all over the place.

Also, slight type in your sample code, missing comma here:

[quote=capasha]words[0].StartsWith(!kick")[/quote]

Offline

#94 2016-05-15 22:33:49, last edited by Xfrogman43 (2016-05-15 22:34:19)

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: [Tutorial] TUTORIALS

AlphaJon wrote:
capasha wrote:

words[0].StartsWith(!kick")

Why does there need to be a comma?
You mean quotation mark


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#95 2016-05-15 22:39:33

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: [Tutorial] TUTORIALS

Fixed. Didn't code it in notepad, I coded it here. The reason I missed "

Offline

#96 2016-05-16 04:02:10

Jabatheblob1
Member
Joined: 2015-03-01
Posts: 856

Re: [Tutorial] TUTORIALS

capasha wrote:

For which good reason was this added? "string msg = m.GetString(1);"
When you just can use m.GetString(1).StartsWith("!command")

I always found it useful to define a variable just in case i start a thread the variable won't change. Especially if it's a command that requires a confirmation from a user, it's easier to just start a thread and wait for them to respond.


If you would like me to make a bot for you, go here.

Offline

#97 2016-05-17 23:32:56

Latif
Member
From: The Netherlands
Joined: 2015-03-13
Posts: 1,206

Re: [Tutorial] TUTORIALS

I have the code of making commands. My bot is done, finally.

But people say everytime: '.wins [username]' But you can't see the wins of someone else.
But it's a pretty good idea.. But I'm too noob to add that :/ I think it's easy. But can someone help me.
I'm a noob..

if (m.Type == "say")
         {
                        if (users.ContainsKey(m.GetInt(0)))
                    {
                        string msg = m.GetString(1);
                        string username = users[m.GetInt(0)];
                        string[] split = msg.Split(' ');
                        string command = "";
                        #region command
                        string[] poss = new string[] { "." };
                        if (poss.Contains(split[0].Substring(0, 1)))
                        {
                            split[0] = split[0].Remove(0, 1);
                            msg = msg.Remove(0, 1);
                            command = split[0];
                        }
                        #endregion
                        if (string.Compare(command, "wins") == 0)
                        {
                            commandsay("/pm " + username + " Wins: " + checkWins(username));
                        }

commandsay is just say but without '[BotName]: '.

Offline

#98 2016-05-18 01:18:50

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: [Tutorial] TUTORIALS

What you need to do is check if it equals ".wins"

if(msg.Equals(".wins"))

else, make it say the msg.SubString(6) of the string.


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#99 2016-05-18 02:24:35

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,853

Re: [Tutorial] TUTORIALS

Xfrogman43 wrote:
capasha wrote:

For which good reason was this added? "string msg = m.GetString(1);"
When you just can use m.GetString(1).StartsWith("!command")

Obviously this guy isn't a good programmer, so I just made it easy instead of having to deal with arrays.

There's a few arguments for using the variable.
Yes, readability. Remembering what number we need (1) is easy now, but what if we were messing with the "m" data?
Also, it's faster to type... and shorter.
My favorite: I like the idea to get into the habit of storing information instead of always calling the function. Sure, a string isn't much overhead, but if we were messing with, say, a LINQ query inside this function... that'd slow down.

Offline

Wooted by:

#100 2016-05-19 15:23:21

Latif
Member
From: The Netherlands
Joined: 2015-03-13
Posts: 1,206

Re: [Tutorial] TUTORIALS

Xfrogman43 wrote:

What you need to do is check if it equals ".wins"

if(msg.Equals(".wins"))

else, make it say the msg.SubString(6) of the string.

I don't understand you 0_o
Can you do the code? Please.. It looks like this now: //forums.everybodyedits.com/img/smilies/sad

//The bot says how many times you've won if you say '.wins'
if (msg.Equals("wins"))
{
    commandsay("/pm " + username + " Wins: " + checkWins(username));
}
//The bot says how many times he/she has won if you say '.wins [username]'
if (msg.Equals("wins " + /*An username*/))
{
     commandsay("/pm " + username + " Wins of this user: " + checkWins(/*The wins of 'An username'*/));
}
//The bot says 3 things if you say '.help'
if (string.Compare(command, "help") == 0)
{
     commandsay("/pm " + username + " Hello! Welcome to BossBot! Go to: www.latifbot.weebly.com for more info please!");
     Thread.Sleep(750);
     commandsay("/pm " + username + " COMMANDS: '.wins' = See how many times you've won. '.wins [player]' = see how many times this player has won");
     Thread.Sleep(750);
     commandsay("/pm " + username + " Enjoy! And have fun!");
}

Offline

John1501101454669737

Board footer

Powered by FluxBB

[ Started around 1733009735.5955 - Generated in 0.109 seconds, 12 queries executed - Memory usage: 1.8 MiB (Peak: 2.09 MiB) ]