Re: Ircle Script
Re: Ircle Script
- Subject: Re: Ircle Script
- From: "Stephen Swift (aka Burnum)" <email@hidden>
- Date: Fri, 23 Feb 2001 11:58:37 -0500
At 2/23/01 1:03 AM, JollyRoger (email@hidden) Wrote:
>
>
tell application "ircle"
>
set myConnection to connection 10
>
set myConnection's servername to "some.server.com"
>
set myConnection's nickname to "Nickname"
>
end tell
Okay this works great.
>
>
> #3 Connect
>
>
> #4 If connection fails switch server and repeat #3
>
>
For this, you'll have to employ the connectionevent() handler:
>
>
on connectionevent(con, e)
>
tell application "ircle"
>
if (e = namesearchfailed) or (e = ipsearchfailed) or (e =
>
openfailed) then
>
-- connection con failed
>
end if
>
end tell
>
end connectionevent
This doesn't work out so great. Sure I've gotten Ircle to read it properly
and all, but I need some more help with some extra script lines.
What Ircle is doing is connecting and the script recognizes it connected so
it tells me the if statement is false. In the meantime, Ircle has
disconnected me because the servers were full. I can't use a delay because
I don't know how long it will take to either get connected or disconnected.
What about a repeat loop?
repeat until (status of connection 10 = connected)
get status of connection 10
if status of connection 10 is offline then
(*See Question*)
end if
end repeat
My question here is, is there away to stop a repeat loop? I'm not sure on
the syntax. Exit? Stop? Quit?
>
>
> #5 Join a channel
>
>
This is as easy as:
>
>
set chanName to "#testing123"
>
tell application "ircle"
>
type "/join " & chanName
>
end tell
Yep...works fine.
>
>
But, as I said in my first response, you'll have to be connected, and the
>
server will have to be connected and ready for commands.
Again... I'm having problems with the timing. On running the script
AppleScript immediately tells me (command = 376) hasn't happened yet and
quits.
One more question on the numeric handler:
>
on numeric(con, command, thestring)
>
if (command = 376) then -- end of MOTD (server should be ready now)
>
-- send server commands
>
end if
>
return false
>
end numeric
Ircle wouldn't run the script with thestring in the list, so I took it out
and it at least tried to run the script. Is thestring needed in this
example?
After that Ircle gave me an error:
-10002 IRC got an error : Invalid Key form
I'm assuming it didn't like what I'm asking it to look for. I'm not sure
why.
>
>
More questions? Ask away. :)
I know this is a lot of question, but this has got me baffled. Thanks.
BTW... Thanks for the events script. Mine wasn't complete for some reason.
Stephen Swift ?' (The Burnum Man)
email@hidden
It9s Coming Back! AppleInfo.net - Check Back Soon
-----------------------------------------------
"One of the deep mysteries to me is our logo, the symbol of lust and
knowledge, bitten into and crossed with the colors of the rainbow in the
wrong order. You couldn't dream of a more appropriate logo: lust,
knowledge, hope, and anarchy." -Jean-Louis Gassie, President of Apple
Products