Difference between revisions of "Thread"

From Unofficial QEdit Wiki Guide
Jump to: navigation, search
 
Line 11: Line 11:
 
Usually used for looping functions that jmp back on their selves (time), or when you need to preform a constant check of a register.
 
Usually used for looping functions that jmp back on their selves (time), or when you need to preform a constant check of a register.
  
 
+
When using threaded functions make sure you start the threaded function with a sync.
  
 
==Example==
 
==Example==

Revision as of 12:10, 18 February 2013

Syntax

Syntax: thread Function

  • Function = Function to thread.

Use

Used to thread a constantly running function regardless of what floor you are on.

Threads allow for the threaded function to run all while letting the main script continue on.

Usually used for looping functions that jmp back on their selves (time), or when you need to preform a constant check of a register.

When using threaded functions make sure you start the threaded function with a sync.

Example


100:     thread 101 //Threads Function 101 so that the main scrip can continue while 101 is going on.
         ret 
101:     sync //Waits 1 frame.
         addi R1, 00000001 //Adds 1 to R1.
         jmp 101 //Jumps back to function 101.

Also see

sync, addi, jmp, ret