Valhalla Legends Forums Archive | C/C++ Programming | Timer in a DLL

AuthorMessageTime
Fr0z3N
I've tried googling it and used msdn but I can't seem to get any to work.
March 18, 2006, 8:10 PM
Myndfyr
What are you doing?
March 18, 2006, 11:11 PM
Fr0z3N
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.
March 18, 2006, 11:50 PM
Myndfyr
[quote author=Fr0z3N link=topic=14539.msg148622#msg148622 date=1142725840]
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]
What is your code like?
March 19, 2006, 12:45 AM
Fr0z3N
[code]
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)
// }
}
[/code]

All I wanna do is be constantly calling that in a timer.
March 19, 2006, 2:18 AM
UserLoser
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/timers.asp
March 19, 2006, 7:05 AM
Fr0z3N
[quote author=UserLoser link=topic=14539.msg148644#msg148644 date=1142751905]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/timers.asp
[/quote]

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?
March 19, 2006, 12:58 PM
Kp
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.
March 19, 2006, 3:44 PM
UserLoser
[quote author=Fr0z3N link=topic=14539.msg148651#msg148651 date=1142773128]
[quote author=UserLoser link=topic=14539.msg148644#msg148644 date=1142751905]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/timers.asp
[/quote]

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?
[/quote]

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.
March 19, 2006, 7:50 PM
Fr0z3N
[quote author=UserLoser link=topic=14539.msg148680#msg148680 date=1142797806]
So you want it spoonfed?
[/quote]

Yes.

I have no Timer code Kp, that's the problem.
March 19, 2006, 9:39 PM
Myndfyr
[quote author=Fr0z3N link=topic=14539.msg148689#msg148689 date=1142804377]
I have no Timer code Kp, that's the problem.
[/quote]
So what you're saying is that you actually *haven't* tried anything?  These things that haven't worked just haven't been tried?
March 19, 2006, 9:51 PM
Quarantine
[quote author=Fr0z3N link=topic=14539.msg148689#msg148689 date=1142804377]
[quote author=UserLoser link=topic=14539.msg148680#msg148680 date=1142797806]
So you want it spoonfed?
[/quote]

Yes.

I have no Timer code Kp, that's the problem.
[/quote]

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.
March 19, 2006, 10:27 PM
Fr0z3N
I tried it all, couldn't figure it out. I'm using a thread now so problem solved.
March 20, 2006, 5:20 AM
FrOzeN
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
March 20, 2006, 6:57 AM
Explicit[nK]
Fr0z3N and FrOzeN, wow.
March 20, 2006, 7:52 AM
warz
[quote author=Explicit[nK] link=topic=14539.msg148728#msg148728 date=1142841140]
Fr0z3N and FrOzeN, wow.
[/quote]

Fr0z3N is the original.
March 20, 2006, 5:43 PM
JoeTheOdd
We also have krazed and craz3d.
March 22, 2006, 1:40 AM
SecretShop
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.
March 30, 2006, 12:01 AM

Search