Quote:
Originally Posted by zap_xlib
Hi,
Can anyone help me with this:
What do i need to append or change in this code for my character to move to an item on ground?. This code just picks up the item at (0,0) w.r.t char.
It would be great if anyone could help me!.
Thank you!.
|
Sounds to me like the drop item packet has changed. Try reading different offsets to find the one that now coresponds with item x/y (print it to console is the easiest way)
items should NEVER be at 0/0, if they are the packet is being read incorrectly.
Quote:
Originally Posted by clarkkenth2005
p4n im noob at programming but i want to learn from you? and im eager to learn pls help... i installed everything what u said on your step by step... and one thing i cant do is how to start to run this proxy what is the 1st thing to do? to run this source of yours...im easy to learn I dont know the 1st thing shall i do... after installing all the necessary stuff? e.x like where to write the code??? and what shall i open to write the code? pls help.... i join elitepvpers and i member of it since feb.. 2006
|
The project file is always what you open. It will easily show you all related .cs files and let you edit them/compile/debug the program.
Quote:
Originally Posted by OELABOELA
i know, but this is my full method:
Code:
public static Mob GetClosestMonster(Client C)
{
Mob ToReturn = null;
int Dist = 7;
if (C.InFatalStrike)
{
Dist = 17;
}
else
{
Dist = 7;
}
foreach (Mob M in C.LocalMobs.Values)
{
if (Distance(C.X, C.Y, M.X, M.Y) < Dist)
{
ToReturn = M;
Dist = Distance(C.X, C.Y, M.X, M.Y);
if (Dist < 2)
break;
}
}
return ToReturn;
}
But i assume he didnt had a working Infatalstrike, so i removed some parts :)
|
Again.. why are you using 7 distance at all? If you are using jump packets you can jump up to 18 distance. You don't need to be in fatal strike to get to mobs that far away. You should ALWAYS be reading the ENTIRE screen for items/mobs. Then simply using your preferred method of transport to get there (teleport across a few diff coords OR jump directly to where you want to go)
@ the video.
Looks like you guys got hunting working quite nicely ^^ Gratz.
Now you just need to sort out other features and looting/dropping properly.
NOTE: the ignore loot was never finished in this version... You'll have an issue cause ground items and inventory items use different uids... meaning you drop an item from your inventory using its uid... but you can't simply ignore that uid for new looting cause it's not using a ground uid (frustrating!)
The work-around I did for that was to set a "last dropped" date time and then read incoming ground item packets to check for items being added to the floor and check the static id vs static id of last item I dropped + when the last dropped item was... then simply assume that the last dropped item of that type (assuming within like... half a second or so) was the one I dropped and ignore it/add to a list of items to NOT loot)
You then need to remove those items NOT to loot after a minute or two (cause uids are re-used!... fun xD)
Basically a proper loot system and sorting out times between diff actions is a pain.
NOTE: Thread.Sleep freezes the entire thread until the time has elapsed... I don't recommend using it often lol.
I've not looked into it but a possible method of doing things would be a timer based action system (after hearing so many horror stories about old 5017 lotf I've mostly avoided timers) but if you resricted their usage and added some basic logic you could do a fairly sexy logic system.
IE:
Action in progress (true when timer running, false when no action of same type is running)
Queue of future actions (handle things in order)
Main processing thread: use the bot thread... always try to avoid using multiple threads or freezing up other main threads (such as processing threads lol!)
Damn... I really wish I didn't have exams... I wanna write my Dynamic Action Queue system for my pserver... it would be so sexy to use for AI logic (basically a queue that auto sorts itself by when the next action occurs... IE: add an item using a delay time value and subtype (and optional packet information) and the queue would auto sort itself so that the next item to be pulled is always the next expire time.