Reply
 
Thread Tools Display Modes
Unread 01-29-12, 04:43 PM   #1
algritz
Claw of Regulos
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 11
How do you "wait" without crashing the game client.

I want to process my mailbox, then take the attachments and finally delete the email.

Two of these actions interacts with the global command queue.

If I want to make sure everything is processed in order, I need to be able to wait after the queue. As such I've created a small function that loops while the queue becomes available.

Code:
local function wait_for_queue()
	local queue_is_not_ready = Inspect.Queue.Status("global")
	while queue_is_not_ready == true do
		queue_is_not_ready = Inspect.Queue.Status("global")
	end
end
Unfortunately when I get in this "loop" the CPU time gets eaten entirely and crashes the Game client.

My question is how do you get to wait for the Queue without crashing the game client?
algritz is offline   Reply With Quote
Unread 01-29-12, 09:21 PM   #2
Myrroddin
Endless Captain
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 50
Answered here.
Myrroddin is offline   Reply With Quote
Unread 01-30-12, 12:26 PM   #3
algritz
Claw of Regulos
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 11
Quote:
Originally Posted by Myrroddin View Post
Answered here.
Saw the reply, thanks !
algritz is offline   Reply With Quote
Unread 02-10-12, 12:21 PM   #4
Zoc
Bomani Harbinger
AddOn Author - Click to view addons
Join Date: Feb 2012
Posts: 6
I'm not able to post on Rift forums (Rift Lite, etc. - willing to change that very soon).

Code:
local queueStatus = false
local function QueueStatus()
    queueStatus = Inspect.Queue.Status("global")
    if queueStatus then return end -- global queue is still backlogged, var is true so exit out
    
    queueStatus = false
end

table.insert(Event.Queue.Status, {QueueStatus, "MyAddon", "Queue Status"})

local commandOne = false
local commandTwo = false
local commandThree = false
function MyAddon:DoCommands()
    if not commandOne and not queueStatus then
        command.blah1
        commandOne = true
    elseif not commandTwo and not queueStatus then
        command.blah2
        commandTwo = true
    elseif not commandThree and not queueStatus then
        command.blah3
        commandThree = true
    end
    
    commandOne, commandTwo, commandThree = false, false, false
end
I'm not able to understand the concept post. I can't find anything related to "Event.Queue.Status", which appears here:
Code:
table.insert(Event.Queue.Status, {QueueStatus, "MyAddon", "Queue Status"})
Anytime I try to run DoCommands(), it never goes past the first step.

What I'm willing to do is, wait until a Command.Item.Move() is complete, then run 2 functions.

Ideas how I can do that ?

Thanks in advance!
Zoc is offline   Reply With Quote
Unread 02-10-12, 02:27 PM   #5
algritz
Claw of Regulos
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 11
Quote:
Originally Posted by Zoc View Post
I'm not able to understand the concept post. I can't find anything related to "Event.Queue.Status", which appears here:
Code:
table.insert(Event.Queue.Status, {QueueStatus, "MyAddon", "Queue Status"})
Anytime I try to run DoCommands(), it never goes past the first step.

What I'm willing to do is, wait until a Command.Item.Move() is complete, then run 2 functions.

Ideas how I can do that ?

Thanks in advance!
Look at this thread, it helped me a LOT.

http://forums.riftgame.com/beta-addo...low-error.html

I ended up combining both a "Queue" and a "thread" manager.
algritz is offline   Reply With Quote
Unread 02-11-12, 03:51 AM   #6
Zoc
Bomani Harbinger
AddOn Author - Click to view addons
Join Date: Feb 2012
Posts: 6
Thank you!

With the info in the post you provided me, I created the LibCoroutine.

It's very early and the code can be considered Alpha quality. It's included with zBag (Alpha4), in case you want to take a look on how I implemented it.

Suggestions / improvements are welcome
Zoc is offline   Reply With Quote
Reply

Go BackRiftui » AddOns, Layouts and Macros » Help/Support » How do you "wait" without crashing the game client.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off