Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - MrMongus

Pages: [1]
1
OpenEUO Scripting Chat / Unresponsible TForm with "while" cycle
« on: November 08, 2019, 05:29:10 AM »
Hello, sorry for maybe stupid question, but I'm stuck while creating menu.
I'm trying (about 14 days of trying and searching) to start and stop "while" cycle by buttons, but when I start cycle then menu stops responding.

I tried all sorts of crazy constructions, but I just couldn't. Certainly it will be related to the fact that I play it in the same thread ...I just don't know how the threads work in LUA, so if anyone would want to advise me, I'll be glad.

Please is there any way I can start and stop a "while" cycle using the form with button ?

Here is my last example of start/stop menu - that stops responding after start of course...
Spoiler: show

local val = false
function Main()
        frmMain = Obj.Create("TForm")
        frmMain.Left =          0
        frmMain.Top =           0
        frmMain.Width =         100
        frmMain.Height =        100
        frmMain.Font.Name =     "Arial"
        frmMain.Font.Size =     8
        frmMain.Caption =       "Some testing text"
        frmMain.OnClose =       function(pSender) Obj.Exit() end
        frmMain.FormStyle =     3
 
        btnStartStop = Obj.Create("TButton")
        btnStartStop.Caption =      "Start/stop"
        btnStartStop.OnClick =      function(pSender) btnOnClick(not val, pSender) end
        btnStartStop.Parent =       frmMain
        btnStartStop.Top =          10
        btnStartStop.Left =         20
        btnStartStop.Width =        100
 
        frmMain.Show()
        Obj.Loop()
end

function btnOnClick(value)
  while value == true do
    print("...")
    wait(500)
  end
end
 
function Clean()
        Obj.Free(btnStartStop)
        Obj.Free(frmMain)
end
 
Main()
Clean()


Thank you very much for your suggestions.

2
New member introductions / New Member Mong
« on: November 05, 2019, 10:21:14 PM »
Hello, at first I'm from Czech Republic and my english is wery bad, so I apologize for the wrong composition of sentences.

At second... I've never seen a more complicated registration(especially for non-English speaking peoples), congratulations, you come first :-D

So... about me... for fun I'm scripting in OpenEUO and I have seen here a lot of examples that I could get inspired from. I'm playing UO on shard, where are a lot of anti-afk controls so inspiration is needed. One example for all - changing positions of gumps that don't have an ID - the sollution was to search gump position by colors and crafting in cellar where everything is black except part of the house...and showed gump :)

Although I have written enough scripts there is still something to learn and I hope to find something here.

Thanks and regards Mong.

Pages: [1]