05-24-2006, 12:03 AM
Code:
DECLARE SUB FindWord ()
DECLARE SUB FindPlace ()
SCREEN 16,,,1
SETMOUSE 1,1,0
TYPE inputs
count AS INTEGER
found AS STRING
END TYPE
DIM SHARED word(10) AS inputs
DIM SHARED cmd$
FindPlace
FindWord
SLEEP
SUB FindWord
INPUT ">",userinput$ 'Get user input
userinput$ = " " + userinput$ 'and add a space to find first word
a = 1 'just another non-existent variable
FOR I = 1 TO LEN(userinput$) 'go by number of letters
IF MID$(userinput$,I,1) = " " THEN 'if it found a space, then
words = words + 1 'add another word,
word(a).count = I + 1 'position of new word
word(a).found = lcase$(MID$(userinput$,word(a).count, 3)) 'store the three-letter code
a = a + 1
END IF
NEXT I
'Search for command-------------------------------------------------
RESTORE commands
FOR J = 1 TO 21
READ cmd$
IF word(1).found = cmd$ THEN EXIT FOR
NEXT
IF word(1).found <> cmd$ THEN PRINT "I don't understand."
'-------------------------------------------------------------------
'Search for first item----------------------------------------------
IF words >= 2 THEN
END IF
commands:
DATA "n","s","e","w","nor","sou","eas","wes","tak","exa","i","inv","l"
DATA "loo","kil","mov","pus","eat","thr","giv","put"
items:
'Weapons
DATA "kni"
'necessary items
DATA "gla","fla"
'expandable items
DATA "poc","sac","bag","usb"
'keys/special items
prepos:
DATA "wit","fro","at","to","by","on","und","ove"
END SUB
SUB FindPlace
area = 1
OPEN "area/" + STR(area) + ".txt" FOR INPUT AS #1
INPUT #1,status
PRINT status
SELECT CASE status
CASE 0
COLOR 7
CASE 1
COLOR 9
CASE 2
COLOR 2
CASE 3
COLOR 4
CASE 4
COLOR 15
END SELECT
CLOSE #1
END SUB
This finds individual words. We should be able to put other stuff in a file and pull it up, the way I designed.
Quote:As a side note, I wish I was a robotic zombie ninja pirate.