Guest Seifer Posted September 2, 2003 Report Posted September 2, 2003 I'm trying to do numerical inputs, i looked at the mervbot tutorial for this but i get this error. C:Do-*BAD WORD*-ents and SettingsSeiferMy Do-*BAD WORD*-entsMERVBot PluginsBasicBotcommand.cpp(131) : error C2065: 'atoi' : undeclared identifier Any idea's?
★ Dustpuppy Posted September 2, 2003 Report Posted September 2, 2003 You can use getInteger() if you're working with merv. http://quotes.sscentral.com/banner.gif
Guest Seifer Posted September 2, 2003 Report Posted September 2, 2003 ok well i got the error sorted, but how can i make it check for a number and take effect on it, so i make !test 1 pm you with, You selected 1. just so i have an example to work on
Dark Nexus Posted September 2, 2003 Report Posted September 2, 2003 switch (c->final (or whatever variable you stored it as)) { case 1: { sendPrivate(p, "You selected 1"); break; } case 2: { sendPrivate(p, "You selected 2"); break; } } http://public.falsefiction.com/upload_files/dark_nexus_moderator.jpg -Freelance Bot and ASSS Development
ExplodyThingy Posted September 2, 2003 Report Posted September 2, 2003 Wont work, as c->final is a string.What will work is using '1', however, that is not a numeric value. try #include for atoi(). In this case, you will want this:int number = atoi(c->final); to sture the int value of c->final to number. Now use sendPirvate(p,"You sent "+String(number)); You can THEN use the switch statement to utilize the number. ~ExplodyOnions3:MikeTheNose> I use my own insanity to communicate
Dark Nexus Posted September 3, 2003 Report Posted September 3, 2003 maybe i am not clear on what you need. But the switch would work, with '1'. But if you needed to do arithmatic with the numbers, then i guess what explody thingy said http://public.falsefiction.com/upload_files/dark_nexus_moderator.jpg -Freelance Bot and ASSS Development
Mr Ekted Posted September 3, 2003 Report Posted September 3, 2003 switch statements only work with integral values. You can't use it to compare strings. switch (atoi(c->final)) { case 1: etc. } http://home.maine.rr.com/user/ekted/pics/ssgc.jpg http://www.againsttcpa.com/images/AgainstTCPA-Log01Small.gif
★ SOS Posted September 3, 2003 Report Posted September 3, 2003 Well it would compare the pointer in that case I think, but yea, that was not going to work
Dark Nexus Posted September 3, 2003 Report Posted September 3, 2003 ooohhhh, because the switch has to have a constant http://public.falsefiction.com/upload_files/dark_nexus_moderator.jpg -Freelance Bot and ASSS Development
Trained Posted September 3, 2003 Report Posted September 3, 2003 Lord Ekted has spoken! All hail Ekted *praises* -TrainedWe’ve created the greatest collection of shared knowledge in history. Help protect Wikipedia. Donate now: http://wikimediafoundation.org/wiki/Support_Wikipedia/en Mom> nothing worse than. "Killed by Mom" popping up Purge is teh bestest person in teh interwebs
Mr Ekted Posted September 3, 2003 Report Posted September 3, 2003 rofl http://home.maine.rr.com/user/ekted/pics/ssgc.jpg http://www.againsttcpa.com/images/AgainstTCPA-Log01Small.gif
ExplodyThingy Posted September 6, 2003 Report Posted September 6, 2003 Hey! Whiskey Tango Foxtrot? I said the same thing as him! ~ExplodyOnions3:MikeTheNose> I use my own insanity to communicate
Recommended Posts