Problem with API Sample #1 - Printable Version +- MMOMinion (https://www.mmominion.com) +-- Forum: FFXIVMinion (https://www.mmominion.com/forumdisplay.php?fid=87) +--- Forum: [DOWNLOADS] Addons, Lua Modules, Navigation Meshes.. (https://www.mmominion.com/forumdisplay.php?fid=90) +---- Forum: I Need Help with LUA coding! (https://www.mmominion.com/forumdisplay.php?fid=104) +---- Thread: Problem with API Sample #1 (/showthread.php?tid=4245) |
Problem with API Sample #1 - Sil - 10-14-2013 I hate to be that guy, but I'm having an issue with copy/pasting the sample#1 found at https://github.com/MMOMinion/FFXIVMinion/wiki/Sample-%231 I copy/paste exactly as it is, and I get an error failed with Code: [string "D:\mmominion\bot\LuaMods\/test/yourmodulename.lua"]:4: unexpected symbol near '.' Code: local mymodule.running = false Can I get some help for the dummy? RE: Problem with API Sample #1 - Gabi - 10-14-2013 The Sample 1 code is correct. I bet there's some invisible character in your Lua code. May I know what editor you're using? RE: Problem with API Sample #1 - Sil - 10-14-2013 Using Notepad++ - typically it always shows any character. Not only that, but I did a direct copy/paste from the <code> section of the page so if there's no hidden character in the code, it should work straight up. RE: Problem with API Sample #1 - z0mg - 10-14-2013 Need the rest too you know. RE: Problem with API Sample #1 - Sil - 10-14-2013 Just got it working. I removed 'local' from the start of line 4 and 5, and it now loads. Any reason why setting it as local would break it? RE: Problem with API Sample #1 - z0mg - 10-14-2013 Haha yes, fire the person who did that. Unless I'm mistaken you can't create a local variable in the global namespace. RE: Problem with API Sample #1 - Sil - 10-14-2013 Don't mean to whip a dead horse but there seems to be a couple things more wrong with the sample Player.health.current seems to throw an error. Player.hp.current does report the correct number, however, I cannot get it to report it to the HP: field. Below is a snippet I've taken out of the sample (with slight edit). d(Player.hp.current) reports to the console perfectly, however the hpvalue = tostring(Player.hp.current) line doesn't actually report it to the HP: field. Code: -- The Mainloop function, gets called all the time by FFXIVMinion: Also, I find that the GUI_NewWindow() function seems to have issues regarding window size and location, and that I need to use GUI_SizeWindow() to accurately display the window. Is this a known issue, or just me breaking stuff? Normally when I want to pick up a new language quickly I take a working sample and break it to see what happens, but it seems I'm try to accomplish the opposite this time :P Lastly, I appreciate the help so far in guiding me, it's appreciated! Nevermind, figured it out. Seems that the window doesn't like displaying fields that are not part of a group. The code below is a 100% functioning "Sample #1". Please stick this up in place of the current one :) Code: -- Create a new table for our code: Now, on to something more useful! |