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.
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
Good point, and no setting him her up for a failure wasnt my intention.
Offline
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...
SHUT AND LISTEN!!!
Offline
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
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
thanks zoey aaaaaaaaaaaand thanks latif for the avatar
Offline
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
Offline
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...
I don't know why he use INI files. Use XML, Json or text documents or MySQL.
Offline
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
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
thanks zoey aaaaaaaaaaaand thanks latif for the avatar
Offline
Offline
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!!!
Offline
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
Uhmm.. Tutorial 7 (make commands) is blocked.
Can someone give me the code. please
(And no, I don't want BotBits)
Offline
Uhmm.. Tutorial 7 (make commands) is blocked.
Can someone give me the code. 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;
thanks zoey aaaaaaaaaaaand thanks latif for the avatar
Offline
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
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.
thanks zoey aaaaaaaaaaaand thanks latif for the avatar
Offline
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
capasha wrote:words[0].StartsWith(!kick")
Why does there need to be a comma?
You mean quotation mark
thanks zoey aaaaaaaaaaaand thanks latif for the avatar
Offline
Fixed. Didn't code it in notepad, I coded it here. The reason I missed "
Offline
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
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
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.
thanks zoey aaaaaaaaaaaand thanks latif for the avatar
Offline
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
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:
//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
[ Started around 1733009267.8352 - Generated in 0.188 seconds, 12 queries executed - Memory usage: 1.8 MiB (Peak: 2.09 MiB) ]