home *** CD-ROM | disk | FTP | other *** search
-
- ;
- ; TagMySig..... TMS V1.00
- ; (C) Loki - s^D 1999
- ; http://www.satanicdreams.freeserve.co.uk
- ; loki@napalmdeath.freeserve.co.uk
- ;
- ; THIS CODE IS COPYRIGHT! YOU MAY NOT USE ANY PART OF IT WITHOUT
- ; EXPRESSED PERMISSION FROM THE AUTOUR!!! (Just mail me and ask
- ; I`m not likely to say no) :)
- ; However, if you are in possession of a shotgun (or pretend you are)
- ; Then you are free to use it however you like SIR! :)
- ;
- ; Have fun!
- ;
-
- Dim Sig$(60)
-
- If NumPars=0 ; If there wer no arguments passed, goto help
- JMP Help
- EndIf
-
- If Par$(1)="?" ; If the user passes `?' as first arg, goto Help
- JMP Help
- EndIf
-
- If NumPars<>4
- If NumPars<>3
- NPrint "Required arguments missing!!" ; if not passed 3 or 4 args
- End
- EndIf
- EndIf
-
- If ReadFile(0,Par$(1))
- FileInput 0 ; Use file for input
- RRandomize Timer ; Make as random as we can
- TagPos.l=RRnd(0,Lof(0)) ; Find a random location in the file
-
- TagPos.l=TagPos*RRnd(0,600) ; Find a longword value, because
- While TagPos>Lof(0) ; RRnd returns a value to the
- TagPos.l=Int(TagPos-RRnd(0,Lof(0))) ; accuracy of a word type, and
- Wend ; this is useless for tagline files that are over 64000 ish bytes
-
- While Byte$<>Chr$(10)
- FileSeek 0,TagPos ; Seek to Random position in the file
- Byte$=Inkey$(1) ; Get 1 byte of info from file.
- TagPos-1
- Wend
-
- TagPos+1
- Byte$=""
-
- While Byte$<>Chr$(10) ; Search until we have a CR (carriage return)
- If Eof(0)
- TagLine$="Oh look, the tagline program had a divvy again!"
- Pop If:Pop While ; Close out loop!
- EndIf
- TagPos+1 ; Move forward in the file
- FileSeek 0,TagPos ; Seek to above pos
- Byte$=Inkey$(1) ; Grab a byte
- TagLine$+Byte$ ; add byte to end of string to makeup tagline
- Wend
-
- TagLine$=UnLeft$(TagLine$,1) ; Rip the CR off string
-
- Else
- NPrint "Cant load your tag-lines file!" ; Error and end
- CloseFile 0
- End
- EndIf
- CloseFile 0
-
- If ReadFile(0,Par$(2)) ; attempt to read the sig!
- FileInput 0
- While NOT Eof(0)
- Sig$(FSize)=Edit$(500) ; parse sig into the array
- FSize+1
- Wend
- EndIf
- CloseFile 0
-
- If WriteFile(0,Par$(2))
- FileOutput 0
- For TMP=0 To (FSize-1)
- If TMP=Val(Par$(3))
- If NumPars=4
- NPrint Par$(4)+TagLine$
- Else
- NPrint TagLine$
- EndIf
- Else
- NPrint Sig$(TMP)
- EndIf
- Next
- EndIf
-
- End
-
- Help
- DefaultOutput
- NPrint "TMS (TagMySig) V1.00 - (C) Loki - s^D 1999"
- NPrint "MailTo:loki@napalmdeath.freeserve.co.uk"
- NPrint ""
- NPrint "Usage: TMS <TagLines_File> <Signature_File> <Strip_Line> [<Prefix_Text>]"
- NPrint ""
- NPrint "Please see the docs for more info on usage."
- End
-
-
-
-