home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
pyrxutil.zip
/
pig_hunt.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
2001-10-19
|
2KB
|
74 lines
/*PYRxUtil demo*/
/* Pig hunter */
/* é ºáßáñÑ «ª¿ñáѼ ºá»π߬ pig.exe .
ìÑ ºáíπñ∞ »α« «απª¿Ñ = xf86sup.sys */
call RxFuncAdd 'PYRxInit','PYRxUtil','PYRxInit'
call PYRxInit
call PYRxGo 'p','#'
ttl = 'Pig hunter'
call PYRxGo 't','??',ttl,'hunter'
do i=1 to hunter.0
do while word(hunter.i,1) \= result
call PYRxMsg ,10,1,,'Sheet !'||'0'x||"I'm late ."||'0'x,
||'Another hunter is here (PID=',
||word(hunter.i,2)||')',,,'Go out'
exit
end
end
call PYRxGo 'p',ttl
do forever
drop pig. ; pig.0 = 0
call PYRxGo 'p','?......?','*\PIG.EXE','pig'
state = (pig.0 = 0)||(bang = 'BANG')
select
when state = '11' then
if msg = 'MSG' then
msg = PYRxMsg('*',,1,,'Pig hunter (PID='result')'||'0'x,
||'No pigs out here'||'0'x||'Give me PIG.EXE')
else
if datatype(msg,'w') then
if \PYRxGo('p','@',result) | \PYRxGo('p','^',result) then
do
call PYRxMsg msg,'-'
msg = ''
end
when state = '01' then
do
if datatype(msg,'w') then
call PYRxMsg msg,'-'
msg = ''
do i=1 to pig.0
pid = word(pig.i,1)
msg = msg||'d'x||'PIG#'i' = 'pid' (0x'||d2x(pid)||')'
end
bang = PYrxMsg(,,,,'Wow !'||'0'x||pig.0' PIGs here :',
||msg,'!',,'Kill','+ defuse')
do i=1 to pig.0
parse var pig.i pid path
call PYRxGo 'P','!',pid
call PYRxKey 1000
call PYRxGo 'P','-',pid
if bang = 12 then
do
'unlock 'path
'ren 'path' *.dead'
end
end
end
when state = '10' then
do
call PYrxMsg ,,,,'Nice shoot !',,,'More pigs','Bye'
if result \= 11 then
exit
else
drop msg bang
end
otherwise
call PYrxMsg ,,,,'Too bad !'||'0'x||"Where's my Gun :((",'?',,'Bye'
exit
end
call PYRxKey 1000
end
exit