Thread Tools Display Modes
01-21-06, 04:26 AM   #1
Vintael
A Defias Bandit
Join Date: Jan 2006
Posts: 2
[beginner question] jumping and timer

Hello all,

I'm learning how to make my own addon @wow, so sorry if my question is too silly
Well, is there a function with the one my charatere will jump every x minutes please?
(jump/move left/right/etc. but the moving functions)
sorry for my english

and thanks a lot
  Reply With Quote
01-22-06, 10:31 AM   #2
Vintael
A Defias Bandit
Join Date: Jan 2006
Posts: 2
well I have found jump() for jumping XD
but I still don't know how to do something every x minutes
anyone please?
  Reply With Quote
01-27-06, 11:29 AM   #3
Aerathi
A Murloc Raider
Join Date: Jan 2006
Posts: 4
Originally Posted by Vintael
well I have found jump() for jumping XD
but I still don't know how to do something every x minutes
anyone please?
You can use on update to do it I believe. I'm going off the top of my head here but:

Code:
MyMod = 
	{
		Timer = 0,			--Timer to keep count
		Frequency = 300		--300 seconds, 5 minutes

	}


function MyMod.OnUpdate(elapsed)
	MyMod.Timer = MyMod.Timer + elapsed
	if (MyMod.Timer > Frequency) then
		Jump();
		MyMod.Timer = 0
	end
end
XML File should have something like:

Code:
<OnUpdate>
	MyMod.OnUpdate();
</OnUpdate>
Just make sure the frame is visible or it will not receive the call to OnUpdate().
  Reply With Quote
01-27-06, 11:53 AM   #4
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
Jump() requires a keypress or click event in order to trigger, so an OnUpdate wouldn't cover it.. you'd need to be a little trickier.

imo.
__________________
"There's only one thing that I know how to do well and I've often been told that you only can do what you know how to do well, and that's be you-- be what you're like-- be like yourself. And so I'm having a wonderful time, but I'd rather be whistling in the dark..."
  Reply With Quote
03-18-06, 06:50 PM   #5
robodude666
A Cyclonian
 
robodude666's Avatar
Join Date: Mar 2006
Posts: 42
Hey,

As I understand, all functions that control movement will be remove in 1.10
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » [beginner question] jumping and timer


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off