mIRC Home    About    Download    Register    News    Help

Print Thread
#202028 12/07/08 08:40 AM
Joined: Jul 2008
Posts: 10
E
Pikka bird
OP Offline
Pikka bird
E
Joined: Jul 2008
Posts: 10
I'm trying to write a simple command that when someone types !profile it will display a link to their profile. the address is the same for everyone except for the id. is there something I can put in between the = and $ but not have a space and not interfere with the link?

Code:
on *:TEXT:!profile:#:{
  if (!$read(Ids.txt, s, $nick)) { msg $chan There is no ID for that nick added. Please add it with !addid Nick ID . }
  else {
    msg $chan $nick $+ 's Profile is: http://www.forphucsake.com/profiles.php?XID=$read(Ids.txt, s, $nick)

it should read
http://www.forphucsake.com/profiles.php?XID=856

ID's are added with this...

Code:
on *:TEXT:!addid*:#:{
  if ($3) {
    if (*Fuck* isin $2-) || (*censored* isin $2-) { msg $chan Don't add swears to the IDs you noob. | halt }
    if ($3 !isnum) { msg $chan $3 is not an ID , use !addid NICK ID | halt }
    write Ids.txt $2 $3
    msg $chan ID Added. 

Evil_Panda #202029 12/07/08 08:47 AM
Joined: Jun 2008
Posts: 48
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Jun 2008
Posts: 48
Code:
http://www.forphucsake.com/profiles.php?XID=$read(Ids.txt, s, $nick)

Would need to be:
Code:
http://www.forphucsake.com/profiles.php?XID= $+ $read(Ids.txt, s, $nick)


All you needed was a space a $+ another space and then the $read line. Im sure its obvious but the $+ sign lets you add items together and is especially handy for things like adding a period to a nickname in a sentence when you used $me or $nick to get it.
If I sent the following line and my name was Typo:
Code:
msg $chan My name is $me $+ .
It would send this to the channel.
Quote:
My name is Typo.

If you are going to use a lot of $+'s in the same line then you would want to use it in the $+(item,item,item,item) format.
Typing the following for example:
Quote:
//echo -a The day and date and time are $+($day,$chr(32),and,$chr(32),$date,$chr(32),and,$chr(32),$time)

would echo back
Quote:
The day and date and time are Saturday and 12/07/2008 and 01:51:51

with your current day, time and date tho.
The $chr(32)'s were used to add a space incase you are not familiar with it.

Anyhow. Good luck and feel free to ask anything else.

Last edited by Typos; 12/07/08 08:57 AM.

I've gone to look for myself. If I should return before I get back, please keep me here.
Typos #202035 12/07/08 03:47 PM
Joined: Jul 2008
Posts: 10
E
Pikka bird
OP Offline
Pikka bird
E
Joined: Jul 2008
Posts: 10
Thanks very much, I knew it would be simple but I don't know much lol and I couldn't find any site with details on variables etc so I'm attempting to write this, its working so far but I don't think I'll get a few things. Is there a site I could do a crash course?

Evil_Panda #202049 12/07/08 10:24 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Not really, there are a few sites with tutorials for various aspects of scripting, but the scripters 'bible' was, is, and probably always will be, the help file in conjunction with forums like this.

Evil_Panda #202051 13/07/08 01:04 AM
Joined: Jun 2008
Posts: 48
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Jun 2008
Posts: 48
http://www.hawkee.com/phpBB2/viewtopic.php?t=14462
Give that tutorial a shot. It's meant for beginner scripters. Also, look in the tutorial section of any mirc scripting site and you will find tutorials on quite a few individual subjects.

RusselB has a great point with the help file in mirc tho. Even the most experienced of scripters rely on the help file all the time and for a new scripter, typing /help /command like /help /echo or /help $identifier like /help $chan or /help feature like /help On Connect, is one of the best things you can do to learn the ins and outs of the commnds, identifier and everything else you can do in mirc.

Good luck and keep at it.


I've gone to look for myself. If I should return before I get back, please keep me here.

Link Copied to Clipboard