www.ClassicTW.com
https://mail.black-squirrel.com/

Attack right person
https://mail.black-squirrel.com/viewtopic.php?f=15&t=13032
Page 1 of 1

Author:  PHX [ Sun May 23, 2004 8:29 pm ]
Post subject: 

How do you skip over attacking unmanned ships and then hitting the correct ship. Either that or look for a specific person, and not just hit any manned ship.

This is what I have....assuming $who = venom .

send "a"
:checkattack
waitfor "Attack "
getword CURRENTLINE $live 2
striptext $live "'s"
if ($live = $who)
send "y " $max "*"
else
send "n"
goto :checkattack
end

But this is what happened...

]:[3601] (?=Help)? : A
<Attack>
Notack 1 [1]'s unmanned Phoenix (70,187-8) (Y/N) [N]?
Notack venom's Phoenix (70,187-79,980) (Y/N) [N]?

Command [TL=00:00:00]:[3601] (?=Help)? : N
<Set Course to NavPoint>

(T) Sector : 1 in The Federation.
Ports : Sol, Class 0 (Special)
Planets : (M) Terra
(S) Sector : 297 in The Federation.
Ports : Stargate Alpha I, Class 9 (Special) (StarDock)
(1) Sector : 6682 in uncharted space.
Ports : Crimson Outpost, Class 3 (SBB)
(2) Sector : 50 (Unknown)
(3) Sector : 495 (Unknown)

Choose NavPoint (?=Help) [Q] :

I have check and the script does accurately get both $who and $live.

I have also tried grabbing word 4 in the attack line and used an IF command to see if that word is "unmanned"...results are the same.

Author:  Rofellos [ Sun May 23, 2004 9:01 pm ]
Post subject: 

I'm not a scripter, but does it matter if it says "venom's" rather than "venom"?

Author:  PHX [ Sun May 23, 2004 10:07 pm ]
Post subject: 

Yes it does...that is why I put in

striptext $live "'s"

it gets rid of the "'s" before checking for a match.

Author:  typh00n [ Sun May 23, 2004 10:24 pm ]
Post subject: 

if you dont want to shoot at unmanned ships - at all
use the twx db to count the # of unmanned ships in sector
(SECTOR.SHIPCOUNT[$sector] i think )
and then just add 'n's accordingly

Author:  Wotok [ Sun May 23, 2004 10:26 pm ]
Post subject: 

Try this....


send "a"
:checkattack
setTextTrigger attack :attack "Attack "
pause
:attack
getword CURRENTLINE $live 2
striptext $live "'s"
if ($live = $who)
send "y " $max "*"
else
send "n"
goto :checkattack
end

Author:  PHX [ Sun May 23, 2004 11:13 pm ]
Post subject: 

Yes I tried using settexttrigger and settextlinetrigger instead of waitfor. No help.

Author:  Agent D [ Mon May 24, 2004 12:05 am ]
Post subject: 

im not an expert scripter but dont u have to define $max ?

Author:  PHX [ Mon May 24, 2004 3:00 am ]
Post subject: 

Max is defined already....this is only part of a much larger script that I like to call "Neighborhood Watch"

$max is the max figs per attack of course which is grabbed automatically by the script earlier on.

Author:  Promethius [ Mon May 24, 2004 5:08 am ]
Post subject: 

quote:Originally posted by PHX

How do you skip over attacking unmanned ships and then hitting the correct ship. Either that or look for a specific person, and not just hit any manned ship.

This is what I have....assuming $who = venom .

send "a"
:checkattack
waitfor "Attack "
getword CURRENTLINE $live 2
striptext $live "'s"
if ($live = $who)
send "y " $max "*"
else
send "n"
goto :checkattack
end



I tried your code snippet and it worked w/o any problem with one minor change:
send "y " $max "*" changed to send "y" $max "*"

I just eliminated the space after the "y" - this was on a version .56 server. I didn't test it extensively - just the first time when it worked after the change.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/