Noob thing to ask but someone got to. How do you add an instance to a listbox? That sounds confusing....Originally Posted by Blaster_89
Noob thing to ask but someone got to. How do you add an instance to a listbox? That sounds confusing....Originally Posted by Blaster_89
[code=c#]Originally Posted by Aggressive Prefector
Waypoint wp = new Waypoint(parameters);
listBox1.Items.Add(wp); /* listBox1.Items is a list of objects of type object. Object as a type can be anything */
[/code]
edit: a listbox is pretty much the same as a list (List<T>), except it also shows its contents to the user by using each object's ToString()
Nice to see you working again Veritias.
you can find tons of code in vb.net in my LaptrotBot source around here.
a suggest: Use a Lookat function or say something in npc channel for an anti-iddle instead to dance. a dance is safe if you are pretty sure that nobody is around there.
Haha, thanks! We will see how this goes though! Still got a lot of work to do.
@ suggestion:
Well, it only moves after 10 minutes, so it's hardly noticeable
But when you need to save it into a file how do you write the objects to a for examble textfile? Just read them as text save them as text? And then parse them to locations when you load them again?Originally Posted by Blaster_89
So I prefere to handle every location, I add it as string read it as string and save it as string.
Why convert numericals to a string? Instead, use BinaryReader or FileStream.Originally Posted by klusbert
Makes the files smaller and you don't have to mess about with converting strings
For example, the structure for a waypoint could be 1 byte waypoint type (walk, node, shovel, rope etc), 2 bytes X, 2 bytes Y and 1 byte Z.
Doesn't really get any easier than that
edit: You could even write a small wrapper for handling byte arrays, then it'd be so easy a beginner could do it with ease
Nop it thats easy enough But if in the future have stuff like script lines etc. Wich my bot have. Maybe I'm beeing stupid again. Beeeeeeer!!!
Humans cant read binary in notepad. Lines of text anyone can read seems simple. No one is going to cry over a few kb in a settings file or waypoint file.
Writing a program to read the data and output it in editable text is a matter of a couple of minutes.Originally Posted by Aggressive Prefector
The advantage of this is cleaner code, and cleaner code means easier maintainability, which is quite important when a bot has all the features a good bot should have.
Don't you guys believe that the work for this project could be better without TibiaAPI itself, I mean to work on the client externally, SendMessage & PostMessage a bot like NeoBot.