Buddy specific away messages!
Moderators: Big-O Ryan, Big-O Mark
Hm...they way i see it, if we were to implament all these features, we hvae have a whole new program hehehe
***Hm...the way i see it, if we were to implement all these features, we have a whole new program hehehe***
Are u refering to me with that Dictionary?
***Hm...the way i see it, if we were to implement all these features, we have a whole new program hehehe***
Are u refering to me with that Dictionary?
Last edited by nunubutt on Fri Sep 13, 2002 7:25 pm, edited 3 times in total.
- Big-O Ryan
- Developer
- Posts: 612
- Joined: Fri Oct 19, 2001 11:00 pm
- Location: Big-O Software
- Contact:
- Plasma2002b
- Extreme Groupie
- Posts: 976
- Joined: Thu Jul 18, 2002 11:36 pm
- Location: Riverside, Ca
- Contact:
- Big-O Ryan
- Developer
- Posts: 612
- Joined: Fri Oct 19, 2001 11:00 pm
- Location: Big-O Software
- Contact:
hehe..
nunubutt: Sorry that you had to the butt of that joke -- I've been waiting impatiently to bust out that dictionary on someone.
[ not my idea, either, I saw it used on another forum somewhere.. but I'm thinking I may have to adopt it as a standard reply for those who earn it.. ]
nunubutt: Sorry that you had to the butt of that joke -- I've been waiting impatiently to bust out that dictionary on someone.
[ not my idea, either, I saw it used on another forum somewhere.. but I'm thinking I may have to adopt it as a standard reply for those who earn it.. ]
-Ryan
Big-O Software
Big-O Software
-
- Moderator
- Posts: 815
- Joined: Sun Sep 22, 2002 3:33 pm
- Contact:
That would be possible, but would almost require some sort of scripting, like with an IF-ELSE statement.
Something like that. It would be kind of complicated...
Code: Select all
if %n == ScreenName1 then
{ away message }
else
if %n == ScreenName2 then
{ away message }
else
{ away message }
-
- Just Registered
- Posts: 3
- Joined: Sun Nov 10, 2002 10:57 pm
- Contact:
I just did this!
It's funny that this is here now, cause just today I wrote a javascript that sends a message to specifc people. It works by attaching the user's screen name to a link with the %n control, then uses javascript to parse out the screen name. This screen name is then used in a switch statement that has a case block for all the people I want to respond too. I also wrote a little replace function that fixes screen names that have spaces in them that would screw up the switch statement.
In profile or wherever-
<a href=thepage.html?name=%n>My message to you!</a>
This goes on the webpage-
<script language="javascript" src="talk.js">
</script>
<SCRIPT LANGUAGE="javascript">
var hst = document.location;
var myString= "" + hst;
myString=myString.substring(myString.lastIndexOf('=')+1,myString.length);
talkTo(myString);
self.close();
</SCRIPT>
talk.js-
function replace(theString, replace, replaceWith){
while(theString.indexOf(replace)!=-1)
theString=theString.substring(0,theString.indexOf(replace))+replaceWith+theString.substring(theString.indexOf(replace)+replace.length,theString.length);
return theString;
}
function talkTo(myString){
myString=replace(myString, "%2520", " "); //I have a bunch of these because what it replaces the space with doesn't seem to be constant across different computers for some reason
myString=replace(myString, "%20", " ");
myString=replace(myString, "%25", " ");
switch (myString.toUpperCase()){
case "GIRLFRIEND":
alert("Hey baby, I love you!")
break;
case "PARENTS":
alert("At the library")
break;
default : alert("I don\'t have anything written for this username, but let me know and I'll add ya!");
}
}
This works well, but the only thing bad is that people can read the messages I want to give to other people if they have half a brain and just realize to manually add the name to the end of the URL. Oh well.
In profile or wherever-
<a href=thepage.html?name=%n>My message to you!</a>
This goes on the webpage-
<script language="javascript" src="talk.js">
</script>
<SCRIPT LANGUAGE="javascript">
var hst = document.location;
var myString= "" + hst;
myString=myString.substring(myString.lastIndexOf('=')+1,myString.length);
talkTo(myString);
self.close();
</SCRIPT>
talk.js-
function replace(theString, replace, replaceWith){
while(theString.indexOf(replace)!=-1)
theString=theString.substring(0,theString.indexOf(replace))+replaceWith+theString.substring(theString.indexOf(replace)+replace.length,theString.length);
return theString;
}
function talkTo(myString){
myString=replace(myString, "%2520", " "); //I have a bunch of these because what it replaces the space with doesn't seem to be constant across different computers for some reason
myString=replace(myString, "%20", " ");
myString=replace(myString, "%25", " ");
switch (myString.toUpperCase()){
case "GIRLFRIEND":
alert("Hey baby, I love you!")
break;
case "PARENTS":
alert("At the library")
break;
default : alert("I don\'t have anything written for this username, but let me know and I'll add ya!");
}
}
This works well, but the only thing bad is that people can read the messages I want to give to other people if they have half a brain and just realize to manually add the name to the end of the URL. Oh well.
-
- Just Registered
- Posts: 3
- Joined: Sun Nov 10, 2002 10:57 pm
- Contact:
I re-wrote the script, this time in PERL so it can be used as a CGI and open inside the buddy info window.
The link in the away message should be-
And the perl script-
This is good if you have a server that you can use PERL on. You can add more stuff to the html part to add color and whatnot if you want to. Was a fun lil' project to learn some perl to write cgi's
The link in the away message should be-
Code: Select all
<a href="http://yourperlserver.com/cgi-bin/message.cgi?%n" target="_self">Click here!</a>
Code: Select all
#!/usr/local/bin/perl
$screenname= $ENV{'QUERY_STRING'};
$screenname =~ s/%2520/ /gi;
$screenname =~ s/%25/ /gi;
$screenname =~ s/%20/ /gi;
$screenname = uc $screenname;
$message= 'I don\'t have anything written for this name, but let me know and I\'ll add ya!';
if($screenname eq 'METALFAN49')
{
$message= 'Hi Me! I guess I have got a working PERL CGI!';
}
if($screenname eq 'GIRLFRIEND')
{
$message = 'Hey baby, why don\'t you meet me Billy\'s house?.';
}
if($screenname eq 'PARENT')
{
$message = 'College is fun and the studying is going great!.';
}
print "Content-type:text/html\n\n";
print <<EndOfHTML;
<html>
<body>
$message
</body>
</html>
EndOfHTML
Code: Select all
Who is online
Users browsing this forum: No registered users and 0 guests