Function player:updatebuffs() not available

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
Rintintin
Posts: 55
Joined: Tue Jan 01, 2013 7:45 am
Location: Germany

Function player:updatebuffs() not available

#1 Post by Rintintin »

As meentioned on
https://www.solarstrike.net/wiki/index. ... _Functions

there should be a function to update the buffs of a player or target. But this does not work (anymore)

Code: Select all

    for k,v in pairs (player.Buffs) do 
        if  v.Id ~= 503827 then goto continue end 
            print (v.Name.." "..v.Count) 
        ::continue::
    end
This code will return the desired buffs but no updates afterwards.
User avatar
Administrator
Site Admin
Posts: 5341
Joined: Sat Jan 05, 2008 4:21 pm

Re: Function player:updatebuffs() not available

#2 Post by Administrator »

You may need to call

Code: Select all

player.updateBuffs()
first. I'm not sure exactly what you are attempting to do, so I think that function isn't automatically called for you in your circumstances.

That would look something like...

Code: Select all

    player.updateBuffs()
    for k,v in pairs (player.Buffs) do 
        if  v.Id ~= 503827 then goto continue end 
            print (v.Name.." "..v.Count) 
        ::continue::
    end
User avatar
Rintintin
Posts: 55
Joined: Tue Jan 01, 2013 7:45 am
Location: Germany

Re: Function player:updatebuffs() not available

#3 Post by Rintintin »

Well I tried the command from the commandline but it threw an error

Code: Select all

player.updateBuffs()
onLoad error: D:/rombot/scripts/rom/classes/pawn.lua:429: attempt to index local 'self' (a nil value)
User avatar
Administrator
Site Admin
Posts: 5341
Joined: Sat Jan 05, 2008 4:21 pm

Re: Function player:updatebuffs() not available

#4 Post by Administrator »

Sorry, my mistake. That should have been a colon (:) instead of dot (.):

Code: Select all

player:updateBuffs();
User avatar
Rintintin
Posts: 55
Joined: Tue Jan 01, 2013 7:45 am
Location: Germany

Re: Function player:updatebuffs() not available

#5 Post by Rintintin »

Oh yes, that does the trick and seems to work.
Post Reply