GO VGopher Hey all - This script isn't really finished, but it works fairly well. Hope the docs make sense. Greets to: - Members of [FiXx] (including myself, of course) - Jimmy (Mark Jimenez) for the suggestions/mods! - Juliana Hatfield!!!!!! (She kicks ass! Get her CD today!) - Kathryn-she'sbeautifulandshelovesme To Do : [X] Arrow Key Manipulation [Done!] [ ] Code beautification ["are you purty?"] [ ] Check algorithm for speed [because it doesn't blaze yet] [ ] Color! [someone needs to help me out on this] [ ] Improve Search [not what I'd call elegant] [ ] Menu Editor Built In [ala Cheeser's AutoSig stuff] ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Screwdriver Access Technologies ³ ³Û ³ Christopher J. Heschong ³ VGopher.V ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ³Û ³ - 1@1615005 VirtualNET ³ A Replacement for the VBBS Bulletin ³Û ³ - ³ Menu (Because it was Boring) ÄÄÄÄÄÄÄ³Û ³ - chris@xtc.net Internet ³ ³Û ³ - The VirtualScrewdriver BBS ³ (Formerly CoolBull) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ³Û ³ (423)975-0347 ³ ³Û ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Revision History: ³Û ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´Û ³ CoolBull ³ VGopher ³Û ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´Û ³ Started: 11-26-93 ³ 10-28-75 ³Û ³ Last Edited: 08-03-94 ³ 08-15-95 ³Û ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Configuration : ³Û ³ Why bother? Just run VGopher, and it will automatically do ³Û ³ the initial setup. After that, all you need to do is maintain ³Û ³ the Data Files, either using VGopher's Built In Data File Editor, ³Û ³ or by using any text editor. Below is a detailed description ³Û ³ of the VGopher Data File Format. ³Û ³ ³Û ³ The automatic initialization process will make a directory called ³Û ³ VGopher directly under your VBBS Text Directory. It will put all ³Û ³ the files it needs and uses there. ³Û ³ ³Û ³ VGopher's Data Files - ³Û ³ ³Û ³ The format of VGopher's Data Files is pretty simple. ³Û ³ Each file consists of a title and items. The title is the first ³Û ³ line of the .GOP file, and the items are the remaining lines. ³Û ³ Each item consists of two lines - An Item Description and an Item ³Û ³ Definition. ³Û ³ The Description is whatever you want the user to see. The ³Û ³ Definition is the file that the user will see or the event that will ³Û ³ be executed. Here is a brief example : ³Û ³ ³Û ³ ³Û ³ ³Û ³ BBS Log ³Û ³ c:\vbbs\data\bbslog ³Û ³ ³Û ³ This would produce a menu entry of : ³Û ³ ³Û ³ 1. BBS Log ³Û ³ ³Û ³ and when the user picks it, he will see the file c:\vbbs\data\bbslog ³Û ³ on his screen. ³Û ³ ³Û ³ Now, you're probably thinking, "But what if I only want SysOps to ³Û ³ see the BBSLog?" Well, you're in luck! VGopher has Security ³Û ³ options built in. To add a security level to the Item Definition, ³Û ³ just change your Definition line to look like this: ³Û ³ ³Û ³ -255c:\vbbs\data\bbslog ³Û ³ ³Û ³ Now, only users with a security level of 255 or above can choose ³Û ³ this item. You may also specify Flag Restrictions by using the ³Û ³ following syntax: ³Û ³ ³Û ³ @Fc:\vbbs\data\bbslog ³Û ³ ³Û ³ With this Definition, only users with the F flag will be able to ³Û ³ choose the item. ³Û ³ ³Û ³ What else can you do besides show text files? Well, here are your ³Û ³ other options - Go to a SubMenu, Download a File, Run a Script, ³Û ³ Run a Door, or run a Shell Command. ³Û ³ ³Û ³ Every Definition is made up of 1-3 parts: ³Û ³ - The Security Type (Optional) ³Û ³ - The Item Type (If not defined, display Text File) ³Û ³ - The Item itself ³Û ³ ³Û ³ ³Û ³ Here are some examples: ³Û ³ BBS Logs ³Û ³ #logs ³Û ³ ³Û ³ This entry would take you to another menu called BBS Logs. The ³Û ³ menu's structure is the same as your top menu. ³Û ³ ³Û ³ Download VBBS 6.14 ³Û ³ %c:\files\vbbs614.zip ³Û ³ ³Û ³ This entry would let the user download VBBS614.ZIP ³Û ³ ³Û ³ GremPost ³Û ³ !grempost ³Û ³ ³Û ³ This definition would run the GremPost VScript when selected. ³Û ³ ³Û ³ Legend of the Red Dragon ³Û ³ *lord.bat %1 ³Û ³ ³Û ³ This would let you run the LORD Door ³Û ³ ³Û ³ Delete Root Directory ³Û ³ .echo Y | del c:\*.* ³Û ³ ³Û ³ And this would delete all the files in your root directory (which ³Û ³ probably isn't a great idea). ³Û ³ ³Û ³ You can also combine Security Types with Item Types. For instance: ³Û ³ ³Û ³ Delete Root Directory ³Û ³ -255.echo Y | del c:\*.* ³Û ³ ³Û ³ would only allow users with 255 security to Delete the contents of ³Û ³ the root directory (again, not a great idea) ³Û ³ ³Û ³ Security Types and Item Types are summarized in the table below: ³Û ³ ³Û ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Security Types ³ Item Types ³Û ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´Û ³ Code Meaning ³ Code Meaning ³Û ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´Û ³ - ³ Security Level ³ # Sub-Menu ³Û ³ @ ³ Flag ³ % Download File ³Û ³ ³ ³ ! VScript ³Û ³ ³ ³ * Door ³Û ³ ³ ³ . Shell ³Û ³ ³ ³ [null] Text File ³Û ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß # VGopher $ver = 0.91 ! VGopher Version Number $top = "top" ! The Top Menu Name $dataext = ".gop" ! Data File Extention $datadir = $textpath & "vgopher\" ! Directory to Data Files (including "\") $sysopsl = 255 ! Security to Add and/or Delete Bulls ! from Menu LOG $handle " entered VGopher" ACTION "VGopher" $ver ! Internal Variable Initialization $up = 254 chr 0 ! Cursor Key Constants (For Local Arrows) $down = 253 chr 0 $right = 251 chr 0 $left = 252 chr 0 $escape = 27 chr 0 ! Escape Key Constant (For Remote Arrows) call setup call dofile $level = 1 $barln = 1 # top $entryfile = "" $entrytitle = "" call displaymenu ifval $level = 1 then $option = "or [5QU]uit" else $option = "[5UU]p or [5QU]uit " endif ifval $security >= $sysopsl then $option = "[5SU]ysOp " & $option endif $foocount = 0 $prompt = "U[61U-6" & $count & "U] " ! @^$#@ 7 token limit... $prompt = $prompt & $option & " =[ " # foo $bottom = $count + 8 $keylist = "SQU?|" & $escape & $up $keylist = $keylist & $down & $right $keylist = $keylist & $left & $cr loc $bottom 1 ts $prompt # food $oldln = $barln loc $bottom 34 RL $key $keylist $count test $key = "Q" realend test $key = "U" end test $key = "S" sysops test $key = "?" top test $key = "|" log test $key = $escape arrowkey test $key = $up up test $key = $down down test $key = $right right test $key = $left left if $key = $cr $key = $barln endif # foob $barln = 1 $oldln = 1 open $datafile INPUT READ $titl # bar READ $entrytitle READ $entryfile $foocount = $foocount + 1 testval $foocount < $key bar CLOSE $datafile $try = $entryfile left 1 $ok = "N" test $try = "-" testsec test $try = "@" testflag $ok = "Y" # display test $ok <> Y nosec test $try = "#" gomenu test $try = "!" goscript test $try = "*" godoor test $try = "." goshell test $try = "%" gobin $ripped = $entryfile upper 0 $ripfound = $ripped instr ".RIP" ifval $ripfound > 0 suspendpagebreak endif tr ef $entryfile resumepagebreak LOG $handle " read " $entrytitle $sprompt = "U[5DU]ownload [5SU]earch [5CU]ontinue => " $niftopts = "ADSC|" & $escape & $up $niftopts = $niftopts & $down & $left $niftopts = $niftopts & $right # nifty tr rr $dlyn $niftopts $sprompt test $dlyn = D dl test $dlyn = A searchtop CLOSE $entryfile test $dlyn = S search test $dlyn = "|" log test $dlyn = $escape top test $dlyn = $up top test $dlyn = $down top test $dlyn = $right top test $dlyn = $left top tr go top # gomenu ! Goes to next menu level $lastj = $lasti $lasti = $lasth ! <- gives you a 10 level recall limit to $lasth = $lastg ! play with. $lastg = $lastf $lastf = $laste $laste = $lastd $lastd = $lastc $lastc = $lastb $lastb = $lasta $lasta = $lastdf $lastdf = $datafile $top = $entryfile mid 2 call dofile $level = $level + 1 go top # goscript returnscript VGopher $toscript = $entryfile mid 2 link $toscript # gobin $entryfile = $entryfile mid 2 go dl # godoor $entryfile = $entryfile mid 2 log $handle " ran " $entrytitle returnscript VGopher door $entryfile # goshell $entryfile = $entryfile mid 2 log $handle " ran " $entrytitle shell $entryfile go top # nosec tr tr "You do not have high enough Security for this option." tr pause go top # dofile ! Gets full pathname of $datafile $datafile = $datadir & $top & $dataext $menufile = $menudir & $top & $menuext OPEN $datafile INPUT CLOSE $datafile RET ! Bar Movement Procedures # arrowkey rc $key ts $bs rc $key test $key = A up test $key = B down test $key = C right test $key = D left go top # up if $barln = 1 $barln = $count else $barln = $barln - 1 endif call drawbar test $sysopmenu = 1 nuts go food # down if $barln = $count $barln = 1 else $barln = $barln + 1 endif call drawbar test $sysopmenu = 1 nuts go food # right $key = $barln test $sysopmenu = 1 nuts go foob # left test $sysopmenu = 1 nuts go end # displaymenu ! Displays Menu $board = $BBSNAME & " VGopher " & $ver $board = $board & " - [Level " & $level $board = $board & "]" JC $board 68 newpage ts $clear tr tr "QÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿U" tr "Q³" $board " ³-ÛU" OPEN $datafile INPUT READ $titl $titlline = $titl JC $titlline 68 tr "Q³" $titlline " ³-ÛU" tr "QÃÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´-ÛU" READ $entrytitle READ $entryfile $count = 0 # menufoo test $entrytitle = "" menubar $count = $count + 1 $countln = $count jr $countln 2 jl $entrytitle 60 ts "Q³ " ts $countln ts ".³ " ts $entrytitle tr "Q ³-ÛU" read $entrytitle read $entryfile test $entryfile = "" menubar test $entryfile = "!EOF!" menubar go menufoo # menubar tr "QÀÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ-ÛU" tr " -ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßU" CLOSE $datafile call drawbar RET # drawbar $ocountln = $oldln jr $ocountln 2 $ocountln = "Q" & $ocountln $countln = $barln jr $countln 2 $countln = "-" & $countln & "Q" $obarpos = $oldln + 5 loc $obarpos 3 ts $ocountln $barpos = $barln + 5 loc $barpos 3 ts $countln RET # testsec $entrysec = $entryfile left 4 mid 2 $entryfile = $entryfile mid 5 $try = $entryfile left 1 if $security >= $entrysec $ok = "Y" else $ok = "N" endif go display # testflag (Fixed by Jimmy! - TNX!) $flagok = $entryfile left 2 mid 2 $z = $flags INSTR $flagok ifval $flagok > 0 then $ok = "Y" endif go display # search tr $readst = "" rs $srchst "UEnter String to Search For : " if $srchst = "" $readst = "!EOF!" endif test $readst = "!EOF!" searchbot tr tr "Searching for string..." OPEN $entryfile INPUT # searchtop read $readst test $readst = "!EOF!" searchbot $found = $readst INSTR $srchst ifval $found > 0 then tr $clear DO $bwoo = 1 $page tr $readst READ $readst LOOP endif testval $found = 0 searchtop # searchbot if $readst = "!EOF!" then tr "Search string not found." endif $sprompt = "USearch[5AU]gain U[5DU]ownload [5SU]earch [5CU]ontinue => " go nifty # dl CLOSE $entryfile download $entryfile LOG $handle " downloaded " $entrytitle " : " $entryfile go top # setup call dofile open $datafile INPUT read $someline CLOSE test $someline <> "" endsetup $datadirlen = $datadir len 0 $datadirlen = $datadirlen - 1 $mkdir = $datadir left $datadirlen $mkdir = "md " & $mkdir & " >nul" tr "VGopher Initialization Phase" tr "- Now Creating VGopher Directory : " $datadir shell $mkdir tr tr "VGopher Initialized. Please edit your TOP Menu by pressing S." # endsetup RET # log logoff # end ifval $level > 1 then $level = $level - 1 $datafile = $lastdf $lastdf = $lasta $lasta = $lastb ! <- Gives you about 10 levels to play with $lastb = $lastc $lastc = $lastd $lastd = $laste $laste = $lastf $lastf = $lastg $lastg = $lasth $lasth = $lasti $lasti = $lastj CLOSE $datafile go top else # realend tr CLOSE $datafile endif ts $clear exit ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ SysOp Configuration Routines ³Û ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´Û ³ This area is almost a completely seperate program, using some of the ³Û ³ same routines, etc. ³Û ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß # sysops $sysmenu = 1 testval $security < $sysopsl sysopsx call displaymenu $prompt = "[A]dd [E]dit [D]elete [Q]uit =[ " $sysopts = "AEDQ|" & $escape & $up $sysopts = $sysopts & $down & $left $sysopts = $sysopts & $right loc $bottom 1 ts $prompt # nuts loc $bottom 34 RL $sysopkey $sysopts $count test $sysopkey = "Q" sysopsx test $sysopkey = "A" sysadd test $sysopkey = "E" sysedit test $sysopkey = "D" sysdel test $sysopkey = "|" log test $sysopkey = $up up test $sysopkey = $down down test $sysopkey = $escape arrowkey go nuts ! I just wanted to have a line in a program that said "go nuts" # sysadd RR $addpos BAQ| "Add [B]efore, [A]fter, or [Q]uit" go sysops # sysedit stack $datafile editfile go sysops # sysdel go sysops # sysopsx $sysmenu = 0 OPEN $datafile INPUT CLOSE $datafile go top ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß