Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Player List
#5
These first people of questions might sound stupid to people but please bare with me here... Can someone please point out why this doesn't work? Obviously I'm doing it wrong but still trying to learn.

Code:
-- Create a new table for our code:
mymodule= { }
-- Some local variables we use in our module:
mymodule.running = false
mymodule.lastticks = 0

-- Initializing function, we create a new Window for our module that has 1 button and 1 field to display data:
function mymodule.ModuleInit()
    GUI_NewWindow("mymodule",350,50,250,250);
    GUI_NewButton("mymodule","Start/Stop Invite","MYMODULE.TOGGLE");
    local el = EntityList("chartype=4", "maxdistance=50", "minlevel=30")
  if ( el ) then
    local i,e = next(el)
    while (i~=nil and e~=nil) do
        //Somehow invite code goes here?
    local i,e = next(el,i)  
    end  
  end
end

-- The function that gets called when the button is pressed:
function mymodule.ToggleRun()
    mymodule.running = not mymodule.running
end

-- The Mainloop function, gets called all the time by FFXIVMinion:
function mymodule.OnUpdateHandler( Event, ticks )
    if ( mymodule.running and ticks - mymodule.lastticks > 500 ) then
        mymodule.lastticks = ticks
-- if the player is alive, set the current HP value into the new field of our created Window:
        if (Player.alive) then
            hpvalue = tostring(Player.health.current)
        end
    end        
end

-- Registering the Events
RegisterEventHandler("Gameloop.Update",mymodule.OnUpdateHandler) -- the normal pulse from the gameloop
RegisterEventHandler("MYMODULE.TOGGLE", mymodule.ToggleRun) -- the function that gets called when our button is pressed
RegisterEventHandler("Module.Initalize",mymodule.ModuleInit) -- the initialization function, gets called only once at startup of the game

Appreciate any help in advance... I'm very keen to learn.
Please be specific when correcting me, I'll learn quicker if I know why things don't work.
Reply
 


Messages In This Thread
Player List - by Drastik - 05-08-2014, 02:18 PM
RE: Player List - by KaWeNGoD - 05-08-2014, 03:01 PM
RE: Player List - by random73 - 05-08-2014, 04:58 PM
RE: Player List - by Drastik - 05-09-2014, 01:24 AM
RE: Player List - by Drastik - 05-09-2014, 05:48 AM
RE: Player List - by Ace - 05-19-2014, 03:53 AM

Forum Jump:


Users browsing this thread: 5 Guest(s)

We help you win the game.

FFXIV Bot and More.

 

Products