home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Univers Interactif 3
/
INTERACTIF.BIN
/
pc
/
planeten
/
internet
/
hyperfin.ger
/
background_2669.txt
< prev
next >
Wrap
Text File
|
1993-12-30
|
5KB
|
216 lines
-- background: 2669 from stack: in.ger
-- bmap block id: 3713
-- flags: 4000
-- background id: 0
-- name: Main
----- HyperTalk script -----
-- HyperFinger (Pro?)
-- Frank D Tito
-- Thu 30 Dec 93
-- I modified the original HyperFinger to learn how it worked. In
-- the process, I untangled and streamlined the code. One no longer
-- needs to be a codehead to understand it. Enjoy.
-- Please send comments and job offers to:
-- ftito@dcseq.uscga.edu until 1/15/93
-- ftito@delphi.com
-- HyperFinger original comments:
-- -- HyperFinger
-- -- September 1991 J. Michael Cherry (cherry@frodo.mgh.harvard.edu)
-- --
-- -- About 99% of the HyperTalk code in this stack is
-- -- from HyperFTP by Douglas Hornig © 1990 Cornell University
-- --
-- -- The XCMDs and XFCNs used here are:
-- -- TCPNameToAddr, TCPSend, TCPRecvUpTo, TCPState, TCPRelease, TCPClose,
-- -- and TCPPassiveOpen by Harry Chesley © 1989 Apple Computer, Inc.
-- --
-- -- Any praise you have for this stack should go to Douglas Hornig and
-- -- Harry Chesley.
on closeStack
global connectionID
-- make sure TCP connection is closed properly
if connectionID is not empty
then
TCPClose connectionID
TCPRelease connectionID
put empty into connectionID
end if
-- if lots of free space in stack, compact stack
if the freeSize of this stack ≥ 40960
then
put the userLevel into saveLevel
if saveLevel < 3 then set the userLevel to 3
send "doMenu Compact Stack" to HyperCard
set the userLevel to saveLevel
end if
end closeStack
on sendLine text
global connectionID
TCPSend connectionID, text & return & linefeed
end sendLine
on finger what, user
global connectionID
-- determine user and hostName
put char 1 to ( offset("@",what) -1 ) of what into user
put char ( offset("@",what) +1 ) to length(what) of what into hostName
-- check for legal name
if (hostName is empty) or (user is what)
then
answer "Please use the format user@host."
exit finger
end if
-- resolve host name
set cursor to busy
promptoid "Finding IP address of" && hostName & "."
get TCPNameToAddr(hostName)
close window "Promptoid"
if char 1 of it is "§"
then
if it contains "couldn't open resource"
then
answer "MacTCP is not installed."
else
answer "Could not get IP address for" && hostName & "."
end if
exit finger
end if
-- open socket 79 for finger service
promptoid "Opening finger service…"
put TCPActiveOpen(item 1 of it, 79, 0) into connectionID
close window "Promptoid"
if connectionID contains "fail"
then
answer "Could not connect to" && hostName & ":" && connectionID
put empty into connectionID
exit finger
end if
-- connection established
promptoid "Connection established. Receiving information."
-- clear field
put empty into bkgnd field "Output"
-- request finger user
sendLine user && return
-- receive finger information
repeat forever
get TCPRecvUpTo(connectionID, linefeed, zero, empty)
if it Γëá empty
then
if char 1 of it is "§" then exit repeat
if char (length of it) of it is linefeed
then
put empty into char (length of it) of it
end if
put it after bkgnd field "Output"
set cursor to busy
end if
end repeat
-- close the connection
close window "Promptoid"
Promptoid "Closing connection."
TCPClose connectionID
TCPRelease connectionID
put empty into connectionID
close window "Promptoid"
end finger
-- part 45 (field)
-- low flags: 21
-- high flags: 0007
-- rect: left=1 top=40 right=199 bottom=511
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Output
----- HyperTalk script -----
on mouseUp
put the clickText into ClickedWord
select the clickChunk
end mouseUp
-- part 113 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=1 top=2 right=19 bottom=51
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Finger╔
----- HyperTalk script -----
-- Finger…
on mouseUp
ask "Finger what?"
put it into what
if what is empty then exit mouseUp
put empty into bg fld "Output"
finger what
end mouseUp
-- part 114 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=1 top=21 right=38 bottom=51
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Copy
----- HyperTalk script -----
on mouseUp
set cursor to busy
set the lockScreen to true
set cursor to busy
set the lockText of bkgnd fld "Output" to false
set cursor to busy
click at the loc of bkgnd fld "Output"
set cursor to busy
select char 1 to 39999 of bkgnd fld "Output"
set cursor to busy
doMenu "Copy Text"
set cursor to busy
set the lockText of bkgnd fld "Output" to true
set cursor to busy
set the lockScreen to false
end mouseUp