TopText "Don't take anything for granted, register TODAY!"
Call WaitPkt('MouseActions')
Packet = GetPKT('MouseActions')
Click = GetArg(packet,0)
Number = GetArg(packet,1)
Name = GetArg(packet,2)
User = GetArg(packet,3)
Reply(packet,0)
Busy On
If Click=1 Then
If Number=0 Then Signal End
Else Signal DoActionOnFile
If Click=2 Then
If Number=0 Then Signal SecretPart
Else Signal AddEntry2File
If Click=q Then Signal End
Busy Off
Signal WaitForSignal
AddEntry2File: Status 3 set ActiveWin
SelectEntry Number 1 1
SelectEntry 0 0 1
Status 3 Set ActiveWin
GetSelectedAll
AllFiles = Result
NumberOfFiles = Words(AllFiles)
Busy On
Call rtezrequest("There are " || NumberOffiles || " selected file(s)." || lf || lf || "Extract file(s) with full path?", "_Yes|_No|_Extract as...|_Cancel","LhA-Control V2.4","RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
Busy Off
If RTResult = 0 Then Signal WaitForSignal
Busy On
If RTResult = 3 Then Signal ExtractAs
TopText 'Building list over file(s) to extract...'
Open('Selected',TmpFiles,'W')
Do Subject = 1 to NumberOfFiles
SelectEntry Word(AllFiles,Subject) 0 1
GetEntry Word(AllFiles,Subject)+1
WriteLn('Selected','"'WildCard(Result)'"')
End Subject
Extract: Close('Selected')
TopText 'Extracting selected file(s)...'
Status 13 1-ActiveWin
Path = Result
If RTResult = 1 Then
Address Command LhA' x -a -qIM -Qw "'CurrentPath || SourceArc'" "@'TmpFiles'" "'Path'"'
Else
Address Command LhA' e -a -qIM -x2 -Qw "'CurrentPath || SourceArc'" "@'TmpFiles'" "'Path'"'
Delete(TmpFiles)
ReScan 1-ActiveWin
Busy Off
Signal WaitForSignal
ExtractAs: TopText "Extracting and renaming file(s)..."
Busy On
Subject=0
GoLoop: Busy On
SelectEntry Word(AllFiles,Subject+1) 0 1
GetEntry Word(AllFiles,Subject+1)+1
Name = Result
TstName = Substr(Name,LastPos("/",Name)+1)
Status 13 1-ActiveWin
Path = Result
Call rtgetstring(Name,"(Use '/' in name for dir creation.)" || lf lf || "Enter New File Name:","LhA-Control V2.4","_Extract|_Skip","RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
Altered = Result
If RTResult = 0 Then Signal FuncCanceled
Busy On
If Exists(Path || Altered) = 1 Then Address Command 'C:Delete "'Path || WildCard(Altered)'"'
Call MakeNeededDir Altered
If Exists(Path || TstName) = 0 Then
Do
Address Command LhA' e -a -qIM -x2 -Qw "'CurrentPath || SourceArc'" "'WildCard(Name)'" "'Path'"'
Address Command 'C:Rename "'Path || WildCard(TstName)'" To "'Path || Altered'"'
End
Else
Do
Address Command LhA' e -a -qIM -x2 -Qw "'CurrentPath || SourceArc'" "'WildCard(Name)'" "'TmpPath'"'
If Altered = WildCard(Altered) Then
Do
Address Command 'C:Copy "'TmpPath || WildCard(TstName)'" To "'Path || Altered'"'
Call rtezrequest("The file has been changed." || lf || "Would you like to update it?","_Sure!|_Forget it!","LhA-Control V2.4", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
Call rtezrequest("The file has been changed." || lf || "Would you like to update it?","_Sure!|_Forget it!","LhA-Control V2.4", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
FindAtr: If left(NoWild,1) = '@' Then NoWild = Insert('*',NoWild,0)
Return NoWild
End: Status 21 ActiveWin set 9
Address Command 'C:Assign "Used By Duff:" Remove'
Address Command 'C:Delete "'Left(TmpPath,Length(TmpPath)-1)'" All NoReq >NIL:'
Busy Off
Exit
Fuser: Call rtezrequest("No file have been selected.","I see","LhA-Control V2.4", "RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
Exit
NotALhAFile: Call rtezrequest("Sorry, but this doesn't seem to be a LhA file.","hmmrf","LhA-Control V2.4", "RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)
Exit
AllReady: Call rtezrequest("Sorry, but LhA-Control can't be runned twice!" || lf || "Should I quit the other LhA-Ctrl.","_Quit other|_No, commit suicide","LhA-Control V2.4", "RT_ReqPos=ReqPos_CenterScr RT_PubScrName="PubScreen)