[codename-alex-dev-commits] src subs.txt,1.4,1.5
Brought to you by:
scriptfellow,
wza
|
From: <wz...@us...> - 2003-01-30 15:00:39
|
Update of /cvsroot/codename-alex/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4108a/src
Modified Files:
subs.txt
Log Message:
subs.txt _readNumberEndingWith: code change (untested)
subs.txt setupItemTypesString: code change (untested)
subs.txt getString: added (untested)
subs.txt findEnemyArray: removed
Index: subs.txt
===================================================================
RCS file: /cvsroot/codename-alex/src/subs.txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** subs.txt 29 Jan 2003 10:22:01 -0000 1.4
--- subs.txt 30 Jan 2003 15:00:34 -0000 1.5
***************
*** 746,779 ****
set %_y %3
set %_amount %4
- ; findItem %_itemID
- ; set %dontwait 0
- ; if %_itemID = #LLIFTEDID
- ; set %dontwait 1
- ; set %oldliftedid #LLIFTEDID
gosub drag %_itemID %_amount
- ; wait 5
- ; if #LLIFTEDID = %oldliftedid
- ; {
- ; if #FINDSTACK > 1
- ; {
- ; if %dontwait = 1
- ; goto enteramount
- ; set %start #SCNT + 2
- ;waitfordrag:
- ; if #SCNT > %start
- ; goto enteramount
- ; if #CONTKIND <> %dragcontkind
- ; goto waitfordrag
- ;enteramount:
- ; if %_amount = 0
- ; msg $
- ; if %_amount > 0
- ; msg %_amount $
- ; }
- ; }
- ; if #LLIFTEDID <> %oldliftedid
- ; wait %delay
gosub drop %_x %_y
- ; click %_x %_y
wait %_dropDelay
return
--- 746,751 ----
***************
*** 1192,1198 ****
; Returns: set variables %_value
;-----------------------------------------------------------
sub _readNumberEndingWith
! ; deleteVar _value
! set %_value N/A
_readNumberEndingWith:
for %_i 0 9
--- 1164,1172 ----
; Returns: set variables %_value
;-----------------------------------------------------------
+ ; ToDo: re-test?
+ ;-----------------------------------------------------------
sub _readNumberEndingWith
! deleteVar _value
! ; set %_value N/A
_readNumberEndingWith:
for %_i 0 9
***************
*** 1201,1208 ****
if %_temp in %2
{
! if %_value <> N/A
set %_value %_i , %_value
! if %_value = N/A
! set %_value %_i
set %1 %_temp
goto _readNumberEndingWith
--- 1175,1182 ----
if %_temp in %2
{
! ; if %_value <> N/A
set %_value %_i , %_value
! ; if %_value = N/A
! ; set %_value %_i
set %1 %_temp
goto _readNumberEndingWith
***************
*** 1371,1414 ****
;===========================================================
- ; Name: findEnemyArray
- ; Status: Still being reviewed
- ; Author: Roadkill
- ; Parameters: %1 = objectTypes
- ; Purpose: find objects of %_objectTypes and arrange data into array
- ; Return: array is %enemyArray, indexes are:
- ; 1=enemyid
- ; 2=enemytype
- ; 3=finddist
- ; 4=findrep
- ; 5=direction
- ; 9=totalfound
- ;-----------------------------------------------------------
- ; ToDo: sub name change to something more generic?
- ; "enemyArray" should be a parameter?
- ;-----------------------------------------------------------
- sub findEnemyArray
- ;purpose:
- ;%1 = %_objectTypes
- ;
- set %_objectTypes %1
- set %_idx 0
- _findEnemyArray:
- set %_idx %_idx + 1
- findItem %_objectTypes %_idx
- if #findKind = 1
- {
- set %enemyArray1 . %_idx #findID
- set %enemyArray2 . %_idx #findType
- set %enemyArray3 . %_idx #findDist
- set %enemyArray4 . %_idx #findRep
- gosub findDirectionTo #findX #findY
- set %enemyArray5 . %_idx %thingsDirection
- goto _findEnemyArray
- }
- set %enemyArray1 . %_idx 0 ;put a 0 after valid spots
- set %enemyArray9 %_idx - 1 ;puts total found enemy position 9
- return
-
- ;===========================================================
; Name: findDirectionTo
; Author: Roadkill
--- 1345,1348 ----
***************
*** 1503,1510 ****
; Return: the final string is held in the variable %ItemTypesString
;-----------------------------------------------------------
sub setupItemTypesString
display ok You will be asked to double-click one of the %1
! ; deleteVar itemTypesString
! set %itemTypesString N/A
_setupItemTypesString:
display yesno Would you like to add a (another) %1 type?$
--- 1437,1446 ----
; Return: the final string is held in the variable %ItemTypesString
;-----------------------------------------------------------
+ ; ToDo: re-test?
+ ;-----------------------------------------------------------
sub setupItemTypesString
display ok You will be asked to double-click one of the %1
! deleteVar itemTypesString
! ; set %itemTypesString N/A
_setupItemTypesString:
display yesno Would you like to add a (another) %1 type?$
***************
*** 1520,1525 ****
;if you get here you've targeted something, carry on with script...
findItem #lTargetID
! if %itemTypesString <> N/A
! {
if #findType in %itemTypesString
; dupe
--- 1456,1461 ----
;if you get here you've targeted something, carry on with script...
findItem #lTargetID
! ; if %itemTypesString <> N/A
! ; {
if #findType in %itemTypesString
; dupe
***************
*** 1528,1534 ****
set %itemTypesString %itemTypesString , _ , #findType
}
! }
! if %itemTypesString = N/A
! set %itemTypesString #findType
goto _setupItemTypesString
}
--- 1464,1470 ----
set %itemTypesString %itemTypesString , _ , #findType
}
! ; }
! ; if %itemTypesString = N/A
! ; set %itemTypesString #findType
goto _setupItemTypesString
}
***************
*** 1572,1574 ****
--- 1508,1552 ----
set %return %return % %_diff
set %return %return + %1
+ return
+
+ ;===========================================================
+ ; Name: getString
+ ; Author: Rolo
+ ; Parameters: %1 = actual string
+ ; %2 = left of desired string in %1
+ ; %3 = right of desired string in %1
+ ; Return: %return is the string in %1 between %2 and %3
+ ; Notes: if %2 isn't in %1 it will return null; if %3 ins't in %1 it will return from %2 to end of %1
+ ; also requires high linespercycle to work efficiantly
+ ; Example: gosub getString #journal you_see:_ *
+ ;-----------------------------------------------------------
+ sub getString
+ set %_string %1
+ set %_preString %2
+ set %_postString %3
+ deleteVar return
+ ; set %return null
+ _getString:
+ set %_temp %_preString , %_postString
+ if %_temp in %_string
+ return
+ set %_check %return
+ gosub _getStringChr _ e t a o i n s r h l d c u m p f g y w b v k x j q z 0 1 2 3 4 5 6 7 8 9
+ if %return = %_check
+ return
+ goto _getString
+
+ sub _getStringChr
+ for %_chrIndex 1 37
+ {
+ set %_chr % . %_chrIndex
+ set %_temp %_preString , %_chr
+ if %_temp in %_string 6
+ set %_preString %_temp
+ ; if %return <> null
+ set %return %return , %_chr
+ ; if %return = null
+ ; set %return %_chr
+ return
+ }
return
|