Keyword
From Unofficial QEdit Wiki Guide
Revision as of 07:34, 2 May 2013 by Japanaman2 (Talk | contribs)
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.
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: get_floor_number R250, R2 //Stores the floor id, and room id that the players are in. Register 2 equals floor id. Register 3 equals room id.
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
Also see
jmpi_=, keyword_detect, keyword,
jmp, get_floor_number, jmpi_!=,