Difference between revisions of "Keyword"
From Unofficial QEdit Wiki Guide
Japanaman2 (Talk | contribs) |
Japanaman2 (Talk | contribs) |
||
Line 17: | Line 17: | ||
<span style='color:green'> thread </span>101 <span style='color:orange'>//Threads function 101.</span> | <span style='color:green'> thread </span>101 <span style='color:orange'>//Threads function 101.</span> | ||
<span style='color:green'> thread </span>103 <span style='color:orange'>//Threads function 103.</span> | <span style='color:green'> thread </span>103 <span style='color:orange'>//Threads function 103.</span> | ||
+ | <span style='color:green'> thread </span>105 <span style='color:orange'>//Threads function 105.</span> | ||
<span style='color:green'> ret </span> | <span style='color:green'> ret </span> | ||
<span style='color:blue'>101: </span><span style='color:green'>sync </span> <span style='color:orange'>//Waits 1 frame.</span> | <span style='color:blue'>101: </span><span style='color:green'>sync </span> <span style='color:orange'>//Waits 1 frame.</span> | ||
Line 24: | Line 25: | ||
<span style='color:red'> keyword </span>R4, R250, pig <span style='color:orange'>//When the word "pig" is said by a player in there message register 4 will equal 00000001.</span> | <span style='color:red'> keyword </span>R4, R250, pig <span style='color:orange'>//When the word "pig" is said by a player in there message register 4 will equal 00000001.</span> | ||
<span style='color:green'> jmp </span>101 <span style='color:orange'>//Jumps to function 101.</span> | <span style='color:green'> jmp </span>101 <span style='color:orange'>//Jumps to function 101.</span> | ||
− | <span style='color:blue'>102: </span> | + | <span style='color:blue'>102: </span><span style='color:green'> clear </span>R4 <span style='color:orange'>//Makes register 4 equal 00000000.</span> |
− | + | ||
<span style='color:green'> jumpi_!= </span>R2, 00000003, 101 <span style='color:orange'>//If register 2 does NOT equal 00000003 (floor id 3) jump to function 101.</span> | <span style='color:green'> jumpi_!= </span>R2, 00000003, 101 <span style='color:orange'>//If register 2 does NOT equal 00000003 (floor id 3) jump to function 101.</span> | ||
<span style='color:green'> jumpi_!= </span>R3, 00000020, 101 <span style='color:orange'>//If register 3 does NOT equal 00000020 (room id 32) jump to function 101.</span> | <span style='color:green'> jumpi_!= </span>R3, 00000020, 101 <span style='color:orange'>//If register 3 does NOT equal 00000020 (room id 32) jump to function 101.</span> | ||
Line 36: | Line 36: | ||
<span style='color:green'> winend </span> <span style='color:orange'>//Closes the window message.</span> | <span style='color:green'> winend </span> <span style='color:orange'>//Closes the window message.</span> | ||
<span style='color:green'> ret </span> | <span style='color:green'> ret </span> | ||
+ | <span style='color:blue'>105: </span><span style='color:green'>sync </span> <span style='color:orange'>//Waits 1 frame.</span> | ||
+ | <span style='color:red'> get_floor_number </span>R250, R2 <span style='color:orange'>//Stores the floor id the player is on in register 2, and stores the room id the player is in in register 3.</span> | ||
+ | <span style='color:green'> jmp </span>105 <span style='color:orange'>//Jumps to function 105.</span> | ||
</span> | </span> | ||
Line 41: | Line 44: | ||
[[ret]], [[get_slotnumber]], [[thread]], | [[ret]], [[get_slotnumber]], [[thread]], | ||
− | [[ | + | [[sync]], [[jmpiue|jmpi_=]], [[keyword_detect]], |
− | [[ | + | [[keyword]], [[jmp]], [[jmpiuexe|jmpi_!=]], |
[[sync_register]], [[window_msg]], [[winend]], | [[sync_register]], [[window_msg]], [[winend]], | ||
− | [[reservedregisters]] | + | [[get_floor_number]], [[reservedregisters]] |
Revision as of 08:07, 2 May 2013
Contents
Syntax
Syntax: keyword register1, register 2, textsting
- register1 = Register to set when keyword is said.
- register2 = Reserved register 250 for player slot number.
- textstring = Keyword to say.
Use
Used to set a register when a keyword is said in the players sent message.
Example
1: ret
100: get_slotnumber R250 //Gets the slot number of the players and stores it in register 250.
thread 101 //Threads function 101.
thread 103 //Threads function 103.
thread 105 //Threads function 105.
ret
101: sync //Waits 1 frame.
jmpi_= R1, 00000001, 1 //If register 1 equals 00000001 jump to function 1.
jmpi_= R4, 00000001, 102 //If register 4 equals 00000001 jump to function 102.
keyword_detect //Allows the searching of keywords when the player sends a message.
keyword R4, R250, pig //When the word "pig" is said by a player in there message register 4 will equal 00000001.
jmp 101 //Jumps to function 101.
102: clear R4 //Makes register 4 equal 00000000.
jumpi_!= R2, 00000003, 101 //If register 2 does NOT equal 00000003 (floor id 3) jump to function 101.
jumpi_!= R3, 00000020, 101 //If register 3 does NOT equal 00000020 (room id 32) jump to function 101.
sync_register R1, 00000001 //Makes register 1 equal 00000001 for all clients.
ret
103: sync //Waits 1 frame.
jmpi_= R1, 00000001, 104 //If register 1 equals 00000001 jump to function 104.
jmp 103 //Jumps to function 103.
104: window_msg Someone said "pig" on floor 3 in room 32. //Displays a window message.
winend //Closes the window message.
ret
105: sync //Waits 1 frame.
get_floor_number R250, R2 //Stores the floor id the player is on in register 2, and stores the room id the player is in in register 3.
jmp 105 //Jumps to function 105.