I've tried googling it and used msdn but I can't seem to get any to work.
What are you doing?
I've injected a dll into d2's memory, and what I want to do is run a timer that checks the users life every 100ms or w/e (making a chicken program) but I can't seem to get any working timer code.
Quote from: Fr0z3N on March 18, 2006, 05:50 PM
I've injected a dll into d2's memory, and what I want to do is run a timer that checks the users life every 100ms or w/e (making a chicken program) but I can't seem to get any working timer code.
What is your code like?
void CheckLife() {
mylife = GetCurrentLife();
maxlife = GetMaxLife();
//sprintf(buffer, "Current Life: %d Max Life: %d", mylife, maxlife);
//PrintMessage(buffer,8);
// if (maxlife/Life > mylife) {
// PrintMessage("CHICKEN!",2)
// }
}
All I wanna do is be constantly calling that in a timer.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/timers.asp
Quote from: UserLoser on March 19, 2006, 01:05 AM
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/timers.asp
Yet another timer function I could not get to work. Is there one where you can simply post the code instead of refering me to a website?
Well, I suppose he could post the contents of the website instead of posting a link to it. :)
Really though, I don't see how we're supposed to help you since you still haven't shown us your timer code, so we have no way of knowing what you're doing wrong.
Quote from: Fr0z3N on March 19, 2006, 06:58 AM
Quote from: UserLoser on March 19, 2006, 01:05 AM
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/timers.asp
Yet another timer function I could not get to work. Is there one where you can simply post the code instead of refering me to a website?
So you want it spoonfed? I find it hard to believe you wrote a library that injects it's self into another games process if you can't figure out two simple function calls and a callback function.
Quote from: UserLoser on March 19, 2006, 01:50 PM
So you want it spoonfed?
Yes.
I have no Timer code Kp, that's the problem.
Quote from: Fr0z3N on March 19, 2006, 03:39 PM
I have no Timer code Kp, that's the problem.
So what you're saying is that you actually *haven't* tried anything? These things that haven't worked just haven't been tried?
Quote from: Fr0z3N on March 19, 2006, 03:39 PM
Quote from: UserLoser on March 19, 2006, 01:50 PM
So you want it spoonfed?
Yes.
I have no Timer code Kp, that's the problem.
I (strongly) suggest you learn what you're doing before you do it. Come on you expect us to believe you were able to somehow write a routine to print to Diablo II's chat screen yet not be able to code something as simplistic as this? Even when information is basically thrown at you, you refuse to look at it -- wait you don't even show signs of trying. Cmon man.
I tried it all, couldn't figure it out. I'm using a thread now so problem solved.
Did you even follow the links? After two clicks it shows that MSDN spoonfeeds it for you anyway. :-\
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/timers/usingtimers.asp
Fr0z3N and FrOzeN, wow.
We also have krazed and craz3d.
Disclaimer: Im not familar with D2 in any way.
With that said, I know this much, D2 is a game with graphics. Those graphics are rendered, to render them there is a loop that draws each frame. It may be easier for you just to place a call to your function that checks the current life of the character in the primary rendering loop of the game.