;woe download prompt v1.o - coded by eini

9
;woe download prompt v1.O - coded by eini ; ;You are allowed to change this program as long as you leave my name in it ;updates may be sent to me because i won't keep coding on this... ;i know.. code looks ugly^M string SelectedColor, UnSelectedColor, Yes, No, Question, key, pcbdir, something string File(200), FileColor, NumberColor, DotColor, Change, DeleteQuestion string RUSure, DelFileNumber, FileExtra(200), a, KeepFilesQuestion, by, Dot string MaxDLFiles, EnterAfterCont, EnterAfterDLFiles, EnterAfterEdit, MaxViewFiles string Del, Add, DelOrAdd, Protocol, AddfileQuestion, AddThis, GoodbyeAfterDl string WaitYN int Y, X, J, k, l, i ;-------------READ CONFIGURATION--------------- fopen 1, ppepath() + "\downlst.cfg", 0, 0 fget 1, SelectedColor fget 1, UnSelectedColor fget 1, Yes fget 1, No fget 1, Change fget 1, Question fget 1, pcbdir fget 1, NumberColor fget 1, DotColor fget 1, Dot fget 1, FileColor fget 1, DeleteQuestion fget 1, RUSure fget 1, EnterAfterEdit fget 1, MaxViewFiles fget 1, DelOrAdd fget 1, Del fget 1, Add fget 1, Protocol fget 1, GoodbyeAfterDl fget 1, AddFileQuestion fget 1, WaitYN fclose 1 ;----------------------------------------------- if (upper(WaitYN) = "Y") wait ;----------------------------------------------- ;Pubs cls by = "woe download prompt - coded by eini" ansipos (80 - Len(By)) / 2, 11 delay 2 PrintLn "@X08" + By

Upload: prentice

Post on 07-Jan-2016

22 views

Category:

Documents


0 download

DESCRIPTION

;woe download prompt v1.O - coded by eini. ;. ;You are allowed to change this program as long as you leave my name in it. ;updates may be sent to me because i won't keep coding on this. ;i know.. code looks ugly^M. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ;woe download prompt v1.O - coded by eini

;woe download prompt v1.O - coded by eini;;You are allowed to change this program as long as you leave my name in it;updates may be sent to me because i won't keep coding on this... ;i know.. code looks ugly^M

string SelectedColor, UnSelectedColor, Yes, No, Question, key, pcbdir, somethingstring File(200), FileColor, NumberColor, DotColor, Change, DeleteQuestionstring RUSure, DelFileNumber, FileExtra(200), a, KeepFilesQuestion, by, Dotstring MaxDLFiles, EnterAfterCont, EnterAfterDLFiles, EnterAfterEdit, MaxViewFilesstring Del, Add, DelOrAdd, Protocol, AddfileQuestion, AddThis, GoodbyeAfterDlstring WaitYNint Y, X, J, k, l, i

;-------------READ CONFIGURATION---------------fopen 1, ppepath() + "\downlst.cfg", 0, 0 fget 1, SelectedColor fget 1, UnSelectedColor fget 1, Yes fget 1, No fget 1, Change fget 1, Question fget 1, pcbdir fget 1, NumberColor fget 1, DotColor fget 1, Dot fget 1, FileColor fget 1, DeleteQuestion fget 1, RUSure fget 1, EnterAfterEdit fget 1, MaxViewFiles fget 1, DelOrAdd fget 1, Del fget 1, Add fget 1, Protocol fget 1, GoodbyeAfterDl fget 1, AddFileQuestion fget 1, WaitYNfclose 1;-----------------------------------------------if (upper(WaitYN) = "Y") wait

;-----------------------------------------------;Pubsclsby = "woe download prompt - coded by eini"ansipos (80 - Len(By)) / 2, 11delay 2PrintLn "@X08" + Byansipos (80 - Len(By)) / 2, 11delay 2PrintLn "@X07" + Byansipos (80 - Len(By)) / 2, 11delay 4PrintLn "@X0F" + Byansipos (80 - Len(By)) / 2, 11delay 2PrintLn "@X07" + Byansipos (80 - Len(By)) / 2, 11delay 2PrintLn "@X08" + Bydelay 2

Page 2: ;woe download prompt v1.O - coded by eini

;-----------------------------------------------clsPrintln "@X8DReading Files, please wait..."PrintlnPrintln "@X0Dwoe download prompt - coded by eini"

;----------------READ FILELIST------------------:StartAllOveri = 0 : j = 0 : k = 0 : l = 0 : x = 0 : y = 0key = ""if (right(pcbdir, 1) == "\") then fopen 2, pcbdir + "flist." + string(pcbnode()) , O_RD, S_DNelseif (right(pcbdir, 1) == "#") then fopen 2, pcbdir + "\node" + string(pcbnode()) + "\flist." + string(pcbnode()), O_RD, S_DNelse fopen 2, "flist." + string(pcbnode()), O_RD, S_DNendif

j = 0file(j) = "NO_FILE"while (!ferr(2)) do j = j + 1 fread 2, FileExtra(j), 66 fread 2, File(j), 63endwhilefclose 2

;-------------READ SECURITY FILE----------------fopen 3, ppepath() + "\levellim.lst", 0, 0getuserwhile (ferr(3) = 0) do fget 3, a if (rtrim(left(a, 4), " ") == u_sec) goto DefineBatchLimitendwhilefclose 3

:DefineBatchLimitMaxDLFiles = ltrim(right(a, 6), " ");-----------------------------------------------

;-------------DISPLAY FILE----------------------clsdispfile ppepath() + "\download.pcb", 0;-----------------------------------------------

;-----------DISPLAY FILELIST--------------------y = gety()for k = 0 to j step 4 if (trim(file(k + 1), " ") = "") goto Done if (l = MaxViewFiles) then newline: wait cls dispfile ppepath() + "\download.pcb", 0 l =0 endif Print NumberColor + string(k + 1) + DotColor + Dot + FileColor + left(File(k + 1) + " ", 15), NumberColor + string(k + 2) + DotColor + Dot + FileColor + left(File(k + 2) + " ", 15), NumberColor + string(k + 3) + DotColor + Dot + FileColor + left(File(k + 3) + " ", 15), NumberColor + string(k + 4) + DotColor + Dot + FileColor + left(File(k + 4) + " ", 15) newline

Page 3: ;woe download prompt v1.O - coded by eini

l = l + 1next k;-----------------------------------------------

;--------------DISPLAY QUESTION-----------------:DoneprintlnprintlnY = GetY()print Question + " " + SelectedColor + " " + Yes + " " + UnSelectedColor + " " + No + " " + Change + " " + "@X80 "X = GetX()ansipos X - 1, Y;-----------------------------------------------

;------------DEFINE KEY-------------------------:NextKeykey = ""while (key == "") do key = inkey()endwhile

select case upper(key)case "Y" ansipos 0, Y print Question + " " + SelectedColor + " " + Yes + " " + UnSelectedColor + " " + No + " " + Change + " " Goto YesKeyPressedcase "N" ansipos 0, Y print Question + " " + UnSelectedColor + " " + Yes + " " + SelectedColor + " " + No + " " + UnSelectedColor + " " + Change + " " Goto NoKeyPressedcase "C" ansipos 0, Y print Question + " " + UnSelectedColor + " " + Yes + " " + " " + No + " " + SelectedColor + " " + Change + " " Goto ChangeKeyPressedcase "LEFT"ansipos 0, Y if (i == 0) then i = 2 print Question + " " + UnSelectedColor + " " + Yes + " " + No + " " + SelectedColor + " " + Change + " " goto NextKey endif if (i == 1) then i = 0 print Question + " " + SelectedColor + " " + Yes + " " + UnSelectedColor + " " + No + " " + Change + " " goto NextKey endif if (i == 2) then i = 1 print Question + " " + UnSelectedColor + " " + Yes + " " + SelectedColor + " " + No + " " + UnSelectedColor + " " + Change + " " goto NextKey endifcase "RIGHT"ansipos 0, Y if (i == 0) then i = 1 print Question + " " + UnSelectedColor + " " + Yes + " " + SelectedColor + " " + No + " " + UnSelectedColor + " " + Change + " "

Page 4: ;woe download prompt v1.O - coded by eini

goto NextKey endif if (i == 1) then i = 2 print Question + " " + UnSelectedColor + " " + Yes + " " + No + " " + SelectedColor + " " + Change + " " goto NextKey endif if (i == 2) then i = 0 print Question + " " + SelectedColor + " " + Yes + " " + UnSelectedColor + " " + No + " " + Change + " " goto NextKey endifcase chr(13) if (i == 0) then goto YesKeyPressed endif if (i == 1) then goto NoKeyPressed endif if (i == 2) then goto ChangeKeyPressed endifcase else goto NextKeyend select;----------------------------------------------

:YesKeyPressedkbdstuff chr(13)newlineend

:NoKeyPressedprintln "" kbdstuff "A" kbdstuff chr(13) kbdstuff "menu"end

:ChangeKeyPressedi = 0newlineprint DelOrAdd + " " + SelectedColor + " " + Del + " " + UnSelectedColor + " " + Add + " " + Protocol + " " + GoodbyeAfterDl + " "Y = GetY()print "@X80 "ansipos GetX() - 3, Y

:NextKey2key = ""while (key == "") do key = inkey()endwhile

select case upper(key)case "D" ansipos 0, Y print DelOrAdd + " " + SelectedColor + " " + Del + " " + UnSelectedColor + " " + Add + " " + Protocol + " " + GoodbyeAfterdl + " " Goto DelKeyPressedcase "A" ansipos 0, Y

Page 5: ;woe download prompt v1.O - coded by eini

print DelOrAdd + " " + UnSelectedColor + " " + Del + " " + SelectedColor + " " + Add + " " + UnSelectedColor + " " + Protocol + " " + GoodbyeAfterdl + " " Goto AddKeyPressedcase "P" ansipos 0, Y print DelOrAdd + " " + UnselectedColor + " " + Del + " " + Add + " " + SelectedColor + " " + Protocol + " " + UnselectedColor + " " + GoodbyeAfterdl + " " goto ProtocolKeyPressedcase "G" ansipos 0, Y print DelOrAdd + " " + UnSelectedColor + " " + Del + " " + Add + " " + Protocol + " " + SelectedColor + " " + GoodbyeAfterdl + " " Goto GoodbyeAfterDownloadcase "LEFT"ansipos 0, Y if (i == 0) then i = 3 print DelOrAdd + " " + UnSelectedColor + " " + Del + " " + Add + " " + Protocol + " " + SelectedColor + " " + GoodbyeAfterdl + " " goto NextKey2 endif if (i == 1) then i = 0 print DelOrAdd + " " + SelectedColor + " " + Del + " " + UnSelectedColor + " " + Add + " " + Protocol + " " + GoodbyeAfterdl + " " goto NextKey2 endif if (i == 2) then i = 1 print DelOrAdd + " " + UnSelectedColor + " " + Del + " " + SelectedColor + " " + Add + " " + UnSelectedColor + " " + Protocol + " " + GoodbyeAfterdl + " " goto NextKey2 endif if (i == 3) then i = 2 print DelOrAdd + " " + UnselectedColor + " " + Del + " " + Add + " " + SelectedColor + " " + Protocol + " " + UnselectedColor + " " + GoodbyeAfterdl + " " goto NextKey2 endif case "RIGHT"ansipos 0, Y if (i == 0) then i = 1 print DelOrAdd + " " + UnSelectedColor + " " + Del + " " + SelectedColor + " " + Add + " " + UnSelectedColor + " " + Protocol + " " + GoodbyeAfterdl + " " goto NextKey2 endif if (i == 1) then i = 2 print DelOrAdd + " " + UnselectedColor + " " + Del + " " + Add + " " + SelectedColor + " " + Protocol + " " + UnselectedColor + " " + GoodbyeAfterdl + " " goto NextKey2 endif if (i == 2) then i = 3 print DelOrAdd + " " + UnSelectedColor + " " + Del + " " + Add + " " + Protocol + " " + SelectedColor + " " + GoodbyeAfterdl + " " goto NextKey2 endif if (i == 3) then i = 0

Page 6: ;woe download prompt v1.O - coded by eini

print DelOrAdd + " " + SelectedColor + " " + Del + " " + UnSelectedColor + " " + Add + " " + Protocol + " " + GoodbyeAfterdl + " " goto NextKey2 endifcase chr(13) if (i == 0) then goto DelKeyPressed endif if (i == 1) then goto AddKeyPressed endif if (i == 2) then goto ProtocolKeyPressed endif if (i == 3) then goto GoodbyeAfterDownload endifcase else goto NextKey2end selectgoto NextKey2

:AddKeyPressedif (flagcnt() = MaxDLFiles) then newline println "@X0FYou can't flag more files! Batch limit reached!" wait cls goto StartAllOverendif;please replace this routine :)newlineinputstr AddFileQuestion, AddThis, "", 12, "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzýü1&|2@'345(6õ^7!89{}0)ø-_ù[]$*%ï`æ=+~/:.;?,<>\", � � � � � �newlineif (trim(AddThis, " ") = "") goto StartAllOver

for i = 1 to j - 1 if (upper(AddThis) == upper(File(i))) then newline println ("File already exists in batch!") wait goto StartAllOver endifnext i

print "@POFF@"newline kbdstuff "E A" if (upper(EnterAfterEdit) = "Y") kbdstuff chr(13) kbdstuff AddThis + chr(13)'------------------------------------------end

:DelKeyPressednewlineinputstr DeleteQuestion, DelFileNumber, "", 19, "0123456789 ", auto if (rtrim(DelFileNumber, " ") == "") Goto StartAllOverprintlna = "Y"inputyn RUSure, a, ""if (upper(a) == "Y") then print "@POFF@"

Page 7: ;woe download prompt v1.O - coded by eini

kbdstuff "E" kbdstuff "R" if (upper(EnterAfterEdit) = "Y") kbdstuff chr(13) kbdstuff DelFileNumber + chr(13) kbdstuff chr(13)else goto StartAllOverendif

:ProtocolKeyPressedprintln "@POFF@"kbdstuff "P"

:GoodbyeAfterDownloadprintln "@POFF@"kbdstuff "G"