home *** CD-ROM | disk | FTP | other *** search
- /* $VER ControlPanel 3.00 (8/1/95)
- ** $Filename: ControlPanel $
- ** $Date: 8.1.95
- ** $Creation: 16.12.94
- **
- ** Arexx Version Of AmiTCP_ControlPanel
- **
- ** Users rexxreqtools.library
- **
- ** (C) Copyright 1994-1995 Martin Carl Hunt
- **
- */
-
- call addlib("libs:rexxarplib.library", 0, -30, 0)
- call addlib("libs:rexxsupport.library", 0, -30, 0)
- call addlib("libs:rexxreqtools.library", 0, -30, 0)
- Address Command
- Call Initialisation()
-
-
- /* If env:user doesn't exist call requester */
- if ~exists("env:user") then call StartAmiTCP ()
-
- /* Main Control Panel Loop */
-
- call open(handle, "env:realname", r)
- Relnme = ReadLn(handle)
- call close(handle)
- call open(handle, "env:user", r)
- USR = ReadLn(handle)
- call close(handle)
-
- do until quit_controlpanel
-
- reqtitle = "AmiTCP Control Panel - Main Menu Current
- User:" || usr || " Real Name:" || relnme
-
- MainMenu = rtezrequest("What do you want to do?", ,
- "_Start|S_top|_Connect|_Disconnect|Change _User|_Applications|A_uto|_Quit", ,
- reqtitle, "rtez_flags = ezreqf_centertext",
- "rt_topoffset = 12" "rt_reqpos = reqpos_topleftscr" "rtez_defaultresponse = 6")
-
- if MainMenu == 0 then quit_controlpanel = 1
- if MainMenu == 1 then call Startnet()
- if MainMenu == 2 then call Stopnet()
- if MainMenu == 3 then call LinkUp()
- if MainMenu == 4 then call LinkDown()
- if MainMenu == 5 then call ChangeUser()
- if MainMenu == 6 then call Applications()
- if mainmenu == 7 then run auto.exe
-
- end
- delay(250)
- "delete t:cp-run#? quiet"
- exit
-
- Initialisation:
- Amitcp = getenv(amitcpdir)
- runno = 0
- NL = '0a'x
- quit_controlpanel = 0
- if screenlace() == 0 then WBSCREENHEIGHT = 250
- if screenlace() == 1 then WBSCREENHEIGHT = 512
-
- RETURN
-
-
-
- StartAmiTCP:
- choice = rtezrequest( "What do you want to do?", " _Start Amitcp | _Quit ", "AmiTCP Control Panel - Startup", "rtez_flags = ezreqf_centertext" "rt_reqpos = reqpos_centerscr")
- if choice == 1 then
- do
- call Startnet()
- "copy amitcp:env/#? env:"
- end
- else exit
- RETURN
-
- Startnet:
- Start = amitcp || "/bin/startnet"
- address command start
- RETURN
-
- Stopnet:
- "stopnet"
- RETURN
-
- LinkUp:
- LinkMenu=""
- if ~exists("Amitcp:bin/plink") then
- do
- LinkMenu = rtezrequest("Do You Want To Collect News" , "_Yes |_No |_Cancel", "AmiTCP Control Panel - Choose News Reader", "rtez_flags = ezreqf_centertext" "rt_reqpos = reqpos_centerscr")
- if linkmenu == 1 then address command "run link up news"
- if linkmenu == 2 then address command "run Link Up"
- end
- else
- do
- LinkMenu = rtgetstring(" ", "Enter FTP Batch File Name If Appropriate" ,"AmiTCP Control Panel - Connect", ,
- " _News | _Forget News | News and then _Disconnect | _Cancel ", "rtez_flags = ezreqf_centertext" "rt_reqpos = reqpos_centerscr" ,
- , LM_result)
-
- plinkparams = ""
- if LM_result ~= 0 then
- do
- if LM_Result == 1 then PlinkParams = "Up NEWS Savenew"
- if LM_Result == 2 then PlinkParams = "Up"
- if LM_Result == 3 then PlinkParams = "Up Autonews Savenew"
- if LinkMenu ~= "" then
- do
- if exists(word(linkmenu,1)) then
- do
- PlinkParam = Plinkparams || " Batch " || LinkMenu
- end
- else
- do
- "ED " linkmenu
- PlinkParam = Plinkparams || " Batch " || LinkMenu
- end
- end
- if linkmenu = "" then plinkparam = plinkparams
- "run >nil: PLINK" plinkparam
- end
- LM_result = "LM_result"
- end
- RETURN
-
-
- LinkDown:
- if exists("amitcp:bin/plink") then "run >nil: plink down"
- else "run >nil: link down"
- RETURN
-
- ChangeUser:
- name_correct = 0
- do until Name_Correct
- call open(handle, "env:realname", a)
- call seek(handle, 0, "B")
- Env_Realname = ReadLn(handle)
- RealName = rtgetstring(Env_Realname, "Enter Your Real Name " || NL || ,
- "i.e. Fred Bloggs ", "AmiTCP Control Panel - Change User", ,
- "_Use |_Save |_Cancel", "rtez_flags = ezreqf_centertext" "rt_reqpos = reqpos_centerscr", CU_RESULT)
- if CU_Result == 0 then RealName = ENV_Realname
- if CU_result ~== 0 then
- do
- call seek(handle, 0, "B")
- call Writeln(handle, RealName)
- end
- if CU_result == 2 then
- do
- call open(handle2, "Amitcp:env/RealName", w)
- call Writeln(handle2, Realname)
- call close (handle2)
- end
- call close (handle)
-
- call open(handle, "env:User", a)
- call seek(handle, 0, "B")
- Env_User = ReadLn(handle)
- CU_Result = "CU_RESULT"
- User = rtgetstring(Env_User, "Enter Your User Name " || NL || ,
- "i.e. Fred ", "AmiTCP Control Panel - Change User", ,
- "_Use |_Save |_Cancel", "rtez_flags = ezreqf_centertext" "rt_reqpos = reqpos_centerscr", Cu_result)
- if CU_result == 0 then User = Env_user
- if CU_result ~== 0 then
- do
- call seek(handle, 0, "B")
- call Writeln(handle, User)
- end
-
- if CU_result == 2 then
- do
- call open(handle2, "amitcp:env/User", w)
- call Writeln(handle2, User)
- call close (handle2)
- end
-
- Call Close(handle)
-
- Name_Correct = rtezrequest("Your REAL NAME is " || RealName || NL ||,
- "Your USER NAME is " || User || NL || NL ||,
- "IS This Correct? ", "_Yes |_No", "AmiTCP Control Panel - Change User", ,
- "rtez_flags = ezreqf_centertext" "rt_reqpos = reqpos_centerscr")
- CU_RESULT = "CU_RESULT"
- end
-
- relnme = RealName
- USR = User
-
- RETURN
-
- Applications:
- do until Cancel = 0
- reqtitle = "AmiTCP Control Panel - Applications Menu Current User:" || usr ||" Real Name:" || relnme
-
- Cancel = rtezrequest("Choose Application To Run", ,
- "_E-Mail|_News|_FTP|_WWW|_Gopher|_IRC|_Archie|_Telnet|_More|_Cancel", ,
- reqtitle, "rtez_flags = ezreqf_centertext",
- "rt_topoffset = 12" "rt_reqpos = reqpos_topleftscr" "rtez_defaultresponse = 9")
-
- Choice = Cancel
- if choice == 1 then if exists("Amitcp:bin/mail") then "run >nil: Mail"
- else "Run >nil: elm"
- if choice == 2 then call whatnews()
- if choice == 3 then "run >nil: gui-ftp"
- if choice == 4 then "run >nil: amosaic"
- if choice == 5 then "run >nil: gopher"
- if choice == 6 then "run >nil: GV"
- if choice == 7 then call runprog(archie_gui || " FILE")
- if choice == 8 then "run >nil: telnet_gui.exe"
- if choice == 9 then
- do
- cancel = 3
- do until cancel <2
- Cancel = rtezrequest("Choose Application To Run", ,
- "_Back|_Finger|_Ping|_TraceRoute|_UUXT|_DeArc|_Ed News|_Cancel", ,
- reqtitle, "rtez_flags = ezreqf_centertext",
- "rt_topoffset = 12" "rt_reqpos = reqpos_topleftscr" "rtez_defaultresponse = 1")
-
- choice = cancel
- if choice == 1 then cancel = 1
- if choice == 2 then call runprog(finger_gui || " FILE")
- if choice == 3 then call runprog(Ping_gui || " SCREEN")
- if choice == 4 then call runprog(traceroute_gui || " FILE")
- if choice == 5 then "run >nil: UUXT-GUI"
- if choice == 6 then "run >nil: GUIARC"
- if choice == 7 then "run Newsed_Gui.exe"
- if choice == 8 then cancel = 0
- end
- end
- end
- RETURN
-
- RunProg:
- arg params
- prog = word(params,1)
- say prog
- output = word(params,2)
- say output
- runno = runno + 1
- filename2 = ""
- filename = "t:cp-run-" || runno
- filename2 = filename || ".output"
- call open(file, filename, 'w')
- if output == "FILE" then
- do
- line1 = "amitcp:bin/" || prog || ".exe > " filename2
- call writeln(file, line1)
- call writeln(file, "ed " || filename2)
- end
- if output ~== "FILE" then do
- line1 = "amitcp:bin/" || prog || ".exe"
- call writeln(file, line1)
- call writeln(file, "Wait 5 secs")
- call writeln(file, "endcli")
- end
- call close(file)
- if output ~== "FILE" then address command "newshell con:0/150/640/100/" || prog || "-OUTPUT from " || filename
- if output == "FILE" then address command "run execute " || filename
- return
-
-
-
-
- WhatNews:
- News_Choice = "NEWS_CHOICE"
- newschoice = 0
- if exists("amitcp:bin/grn") then newschoice = newschoice +1
- if exists("amitcp:bin/othernews.run") then newschoice = newschoice + 1
- if newschoice ~== 0 then
- do
- News_Choice = rtezrequest("What News Reader Do You Wish To Use?" , "_Tin |_Grn |_Other", "AmiTCP Control Panel - Choose News Reader", "rtez_flags = ezreqf_centertext" "rt_reqpos = reqpos_centerscr")
-
- if news_choice == 1 then "run tinnews"
- if news_choice == 2 then "run grn Left=30 Height="WBScreenHeight
- if news_choice == 0 then "run execute amitcp:bin/othernews.run"
- end
- if newschoice == 0 then "run tinnews"
- return
-
-