lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Lua Programming Help (L)

Reply
Thread Tools Display Modes
  #11  
Unread 06-10-2012, 07:57 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 341
Quote:
Originally Posted by moebius92
Actually, the loop variable of a for loop always has a scope that is local to the for loop itself. So I think Kunter's okay in this case.
True. Loop was a bad example.
Reply With Quote
  #12  
Unread 06-11-2012, 05:40 AM
Kunter Kunter is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Jun 2012
Posts: 7
Code:
function Disease()
	for effectnumber=1, EffectList:GetCount(), 1 do
		if EffectList:Get(effectnumber):IsCurable() then
		Turbine.Shell.WriteLine(EffectList:Get(effectnumber):GetName());
			if (EffectList:Get(effectnumber):GetName() == "Effectname here") then
				return 0.5;
				break;
			end
		end
	end
	return 0;
end
I'd rewrite the function, I hope I get better results now, the WriteLine command is only to log the Buffnames.
Reply With Quote
  #13  
Unread 06-19-2012, 01:17 PM
Kunter Kunter is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Jun 2012
Posts: 7
Ok, tested the plugin today, works fine, if Jackdaw is ok with it I will publish it in a few days.
Reply With Quote
  #14  
Unread 07-31-2012, 03:35 AM
Snoopy81 Snoopy81 is offline
The Wary
Interface Author - Click to view interfaces
 
Join Date: Feb 2012
Posts: 2
Catching effects

There is 2 ways to catch an effect on the player...

- 1st one as above is to scan "EffectList = LocalPlayer:GetEffects();" at regular intervals (ie: onTimer or on Refresh )

- 2nd, I'd say a cleaner way is to catch events AddCallback(EffectList, "EffectAdded", MyEffectChangedCallback); and "EffectRemoved"

Last edited by Snoopy81 : 07-31-2012 at 03:44 AM.
Reply With Quote
  #15  
Unread 08-01-2012, 06:49 PM
Kunter Kunter is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Jun 2012
Posts: 7
Quote:
Originally Posted by Snoopy81
There is 2 ways to catch an effect on the player...

- 1st one as above is to scan "EffectList = LocalPlayer:GetEffects();" at regular intervals (ie: onTimer or on Refresh )

- 2nd, I'd say a cleaner way is to catch events AddCallback(EffectList, "EffectAdded", MyEffectChangedCallback); and "EffectRemoved"
http://www.lotrointerface.com/downlo...ffectWarn.html

I used this:

EffectList = Turbine.Gameplay.LocalPlayer:GetInstance():GetEffe cts();

and this

AddCallback(EffectList,"EffectAdded", --function to handle event--);

So pretty much the same. EffectWarn works very fast and by the time 5 evenings at Saruman show that it is reliable (anyhow for me).
Reply With Quote
Reply


Thread Tools
Display Modes

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
Forum Jump


All times are GMT -5. The time now is 06:01 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui