psyic
New Member
Posts: 20
|
Post by psyic on Oct 31, 2005 19:00:20 GMT -5
MyTextObject=Graphics.text_CreateObject() Graphics.text_SetPosition(100,100,MyTextObject) Graphics.text_SetColor(255,255,255,255,MyTextObject) Graphics.text_SetFont("Impact",20,MyTextObject) Graphics.text_SetBold(true,MyTextObject)
-- Would-be variable declairation BoostWear=0 BoostNum=0 BoostCast=0
--Main loop... God I hate Lua... while true do
--Take commands UserInput=Windower.script_GetCommand() if not UserInput==" " then if UserInput=="boost" then
if BoostWear==0 then --If timer equal 0, (re)set timer BoostWear=180 end
BoostCast=15 BoostNum=BoostNum + 1 elseif UserInput=="blast" then BoostNum=0 BoostWear=0 else Windower.console_Write("Command not understood.") end end
--Text output output=string.format("Time til boost wears: %i \n# of boosts currently: %i \n Boost recast: %i", BoostWear,BoostNum,BoostCast) Graphics.text_SetText(Output,MyTextObject) Windower.script_Sleep(1000)
--decrement timers if BoostWear > 0 then BoostWear=BoostWear - 1 end if BoostCast > 0 then BoostCast=BoostCast - 1 end end
Using the latest (1649 alpha) of Lunar. FF creates an error, then takes it's time and exits out quietly. Here's the error sig: AppName: pol.exe AppVer: 1.15.2.0 ModName: hook.dll ModVer: 3.2.1.0 Offset: 000550ce
Hope this is useful in tracking something down
|
|
|
Post by TinyTerror on Oct 31, 2005 20:33:11 GMT -5
I would have to guess its the command calls. The command stuff was enver well tested.
|
|
psyic
New Member
Posts: 20
|
Post by psyic on Nov 1, 2005 8:40:37 GMT -5
lol, ok
|
|
Rzn
Junior Member
Posts: 55
|
Post by Rzn on Nov 1, 2005 9:26:44 GMT -5
MyText=Graphics.text_CreateObject() Graphics.text_SetColor(255,255,255,255,MyText) Graphics.text_SetPosition(200,100,MyText) Graphics.text_SetFont("Arial",11,MyText) Graphics.text_SetVisibility(1,MyText)
Input=Windower.script_GetCommand()
Output=string.format("Input %s",Input) Graphics.text_SetText(Output,MyText) Windower.script_Sleep(7000) Graphics.text_DeleteAll() [/code
This works for me. Take another look over your code the only thing i see wrong with it is line 35: output ~ Output.
|
|
|
Post by TinyTerror on Nov 1, 2005 9:31:22 GMT -5
I want to convert the whole command/argument passing mechanism over to STL and non dynamic memory. It might take up a bit more memory at runtime, but its a lot less likely to have problems.
|
|
Rzn
Junior Member
Posts: 55
|
Post by Rzn on Nov 1, 2005 9:34:21 GMT -5
Wouldn't non dynamic memory cause access violations?
BTW <3 spell check
|
|
|
Post by TinyTerror on Nov 1, 2005 10:02:53 GMT -5
No.
|
|
|
Post by TinyTerror on Nov 1, 2005 11:25:22 GMT -5
Ok, the arguments and command code have been replaced with new hopefuly more stable code. I also added access locks to the name, author, version, and contact functions. This will prevent insanity if more than one thread tries to read/write this info at the same time.
|
|