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 » Tue May 04, 2021 4:14 am

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: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Function player:updatebuffs() not available

#2 Post by Administrator » Wed May 05, 2021 11:08 am

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 » Tue May 11, 2021 10:07 am

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: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Function player:updatebuffs() not available

#4 Post by Administrator » Tue May 11, 2021 10:33 am

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 » Wed May 12, 2021 2:57 pm

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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 19 guests