home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / comm / spot-1.3.lha / Spot / Rexx / IntuiNode.spot < prev    next >
Text File  |  1994-01-31  |  2KB  |  88 lines

  1. /* Nodelist look-up for Spot        */
  2. /* by Johan Billing 2:203/602.32    */
  3.  
  4. /* Tiny manual: If you want to, you can write REQ as a parameter   */
  5. /* for the script in the ARexx window. The script will then open a */
  6. /* string requester where you can enter a node to look up.         */
  7.  
  8. nodelist = "NODELIST:"
  9.  
  10. IF ~SHOW(Libraries,'traplist.library') THEN
  11.     IF ~ADDLIB("traplist.library",0,-30,0) THEN EXIT
  12.  
  13. cr='0d'x
  14.  
  15. options results
  16. address 'SPOT'
  17.  
  18. parse arg req
  19.  
  20. if upper(req)=="REQ" then do
  21.  node=""
  22.  call asknode
  23.  res = FindNode(node,"All",nodelist)
  24. end
  25. else do
  26.  getfromaddress
  27.  node=result
  28.  point=0
  29.  parse var node zone":"net"/"nod"."point
  30.  
  31.  res = FindNode(node,"All",nodelist)
  32.  
  33.  if left(res,1)=="0" & point~=0 then do
  34.   point=0
  35.   node=zone":"net"/"nod"."point
  36.   say node
  37.   res = FindNode(node,"All",nodelist)
  38.  end
  39. end
  40.  
  41. do forever
  42.  parse var res error" "nod","sysop","name","phone","city","password","baud","cost","region","hub","flags
  43.  parse var node zone":"net"/"nod"."point
  44.  
  45.  if left(res,1)=="0" then do
  46.   string="Node "node" not found"
  47.   title="IntuiNode.rexx Error"
  48.  end
  49.  else do
  50.   string=" Name: " || left(name,40) || cr || "Sysop: " || left(sysop,22) || "City: " || city || cr || "Phone: " || left(phone,22) || "Baud: " || baud || cr || "Flags: " || flags
  51.   title="Node "node
  52.  end
  53.  
  54.  if point==0 then do
  55.   gads="_New node|_Quit"
  56.  end
  57.  else do
  58.   gads="_New node|_Boss|_Quit"
  59.  end
  60.  
  61.  'requestresponse TITLE "' || title || '" PROMPT "' || string || '" GADGETS "' || gads || '"'
  62.  
  63.  if rc==0 then do
  64.   exit
  65.  end
  66.  
  67.  else if rc==1 then do
  68.   call asknode
  69.   res = FindNode(node,"All",nodelist)
  70.  end
  71.  
  72.  else if rc==2 then do
  73.   point=0
  74.   node=zone":"net"/"nod"."point
  75.   res=FindNode(node,"All",nodelist)
  76.  end
  77. end
  78.  
  79. asknode:
  80.  'requeststring TITLE "Enter a node number" DEFAULT "'node'"'
  81.  node=result
  82.  
  83.  if node=="" | rc==5 then do
  84.   exit
  85.  end
  86.  
  87.  return
  88.