Rzn
Junior Member
Posts: 55
|
Post by Rzn on Oct 30, 2005 6:01:59 GMT -5
This script hung loading twice due to login probs and lack of sleep i didn't get to test it farther. there could be something wrong with the script. good night
[Fight_PreTest.lua]
MyText=Graphics.text_CreateObject() Graphics.text_SetColor(255,255,255,255,MyText) Graphics.text_SetPosition(100,100,MyText) Graphics.text_SetFont("Arial",10,MyText) Graphics.text_SetVisibility(1,MyText)
Status=FFXI.player_GetStatus() while Status==38 do Temp={FFXI.target_GetHPPercent()}
if (Temp)>(FFXI.target_GetHPPercent()) or (Temp)==(FFXI.target_GetHPPercent()) then Left=1 else Left=0 end
Temp={FFXI.target_GetHPPercent()}
if (Temp)>(FFXI.target_GetHPPercent()) or (Temp)==(FFXI.target_GetHPPercent()) then Right=1 else Right=0 end
Output=string.format("Left: %i\r\n Right: %i\r\n",Left,Right)
Graphics.text_SetText(Output,MyText)
end
|
|
psyic
New Member
Posts: 20
|
Post by psyic on Oct 30, 2005 6:37:16 GMT -5
I would say it has something to do with Lua's syntax. I don't know why, but I'm really hating Lua the more and more I see it.
One thing you might want to do is some removal of the text while FFXI.player_GetStatus doesn't equal 38. I would also encapsulate everything from Status=FFXI.player_GetStatus() to end with a "while true do ... end" so it goes on past when you're not fishing, then add a delay at the end.
|
|
|
Post by TinyTerror on Oct 30, 2005 11:56:37 GMT -5
I want you both to remember what alpha means. When software is in alpha, it is has all of the features intended for release, but is not stable. Lunar still has a ton of bugs. The testing I did on it was not extensive simply because I didn't have the time to test it. Things will get better for each release. I will be working on load/unload issues today.
Psyic is right. You need to add a delay in your loops so that they don't run out of control. Putting a Windower.script_Sleep(10) in will make your code run smoothly without giving up any performance.
|
|
psyic
New Member
Posts: 20
|
Post by psyic on Oct 30, 2005 22:36:05 GMT -5
Tiny, is Lua not intended to be indented inside loops and functions?
|
|
|
Post by TinyTerror on Oct 30, 2005 22:47:06 GMT -5
Indentation doesn't make a difference in execution behavior. Its really a personal style thing.
|
|
Rzn
Junior Member
Posts: 55
|
Post by Rzn on Oct 30, 2005 22:49:54 GMT -5
i still can't get this to load even with wait or wait for input tho the one posted doesn't call the table correctly but even in the fixed version it hangs at load.
|
|
|
Post by TinyTerror on Oct 30, 2005 23:00:11 GMT -5
What is [Fight_PreTest.lua] ? Is this actually in your script?
|
|
Rzn
Junior Member
Posts: 55
|
Post by Rzn on Oct 30, 2005 23:05:36 GMT -5
just put that on here in case i needed to find the file later
|
|
|
Post by TinyTerror on Oct 30, 2005 23:10:33 GMT -5
Yeah well, you need to comment it. [ and ] are used as table operators in lua. I'll bet you a dollar thats why it bows up when you load it. Try --Fight_PreTest.lua insted. That should work for you.
|
|
Rzn
Junior Member
Posts: 55
|
Post by Rzn on Oct 30, 2005 23:12:26 GMT -5
its not in the script just in my post
|
|
|
Post by TinyTerror on Oct 31, 2005 0:25:02 GMT -5
Ok, just making sure. I'll look into this more tomorrow.
|
|
Rzn
Junior Member
Posts: 55
|
Post by Rzn on Oct 31, 2005 21:12:05 GMT -5
|
|
|
Post by TinyTerror on Nov 1, 2005 12:16:40 GMT -5
Make me a zip file with two folders in it. In the first folder named WORKING, put the working script and its graphics. In the second folder called BUSTED, put the non working script and its graphics. I'll windiff the two to see if there are any differences. The two zip files you posted have different scripts in them. I want to be sure i'm looking at the right scripts.
|
|
Rzn
Junior Member
Posts: 55
|
Post by Rzn on Nov 1, 2005 21:19:37 GMT -5
|
|