mIRC Home    About    Download    Register    News    Help

Topic Options
#202028 - 12/07/08 09:40 AM =$read
Evil_Panda Offline
Pikka bird

Registered: 12/07/08
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. 

Top
#202029 - 12/07/08 09:47 AM Re: =$read [Re: Evil_Panda]
Typos Offline
Ameglian cow

Registered: 27/06/08
Posts: 48
Loc: Seattle/Tacoma Washington
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.


Edited by Typos (12/07/08 09:57 AM)
_________________________
I've gone to look for myself. If I should return before I get back, please keep me here.

Top
#202035 - 12/07/08 04:47 PM Re: =$read [Re: Typos]
Evil_Panda Offline
Pikka bird

Registered: 12/07/08
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?

Top
#202049 - 12/07/08 11:24 PM Re: =$read [Re: Evil_Panda]
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
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.

Top
#202051 - 13/07/08 02:04 AM Re: =$read [Re: Evil_Panda]
Typos Offline
Ameglian cow

Registered: 27/06/08
Posts: 48
Loc: Seattle/Tacoma Washington
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.

Top