mIRC Home    About    Download    Register    News    Help

Print Thread
#197033 27/03/08 01:31 PM
Joined: Mar 2007
Posts: 218
V
vexed2 Offline OP
Fjord artisan
OP Offline
Fjord artisan
V
Joined: Mar 2007
Posts: 218
I have made a small ascii word, which i want to echo when i join a channel, i don't know whether to use echo or put it in a file, the problem i have is that it contains (/) back slashes, so mIRC thinks it's a commands and gets messed up, how do i get around that? cheers.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
mIRC should not treat it as a command unless the / is the first character on the line or follows a | and a space.

Code:
//echo -a /\/\

on *:join:#: { echo -a /this\is/some\test/to\echo/ }


Invision Support
#Invision on irc.irchighway.net
Joined: Mar 2007
Posts: 218
V
vexed2 Offline OP
Fjord artisan
OP Offline
Fjord artisan
V
Joined: Mar 2007
Posts: 218
I'm calling my own alias as soon as i've joined the channel.
I tried it like this
Code:
alias blah {
echo $1  __   _       ___       ___  ___   _____   _____  
echo $1 |  \ | |     /   |     /   |/   | | ____| /  ___/ 
echo $1 |   \| |    / /| |    / /|   /| | | |__   | |___  
echo $1 | |\   |   / / | |   / / |__/ | | |  __|  \___  \ 
echo $1 | | \  |  / /  | |  / /       | | | |___   ___| | 
echo $1 |_|  \_| /_/   |_| /_/        |_| |_____| /_____/ 
}


and it doesn't work

| Unknown command
| Unknown command
| Unknown command
|___ Unknown command

the usual scenario

Last edited by vexed2; 27/03/08 01:50 PM.
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
| is a command separator, normal that it should be interpreted as such when it's spaced out that way. also mirc strips consecutive spaces when you use them in commands

you can solve both of these problems by changing each space to a hardspace ($chr(160)), or if that's not feasible solution you can insert invisible characters (such as control codes) in between every consecutive space. there's also saturn's spaces.dll which would require a bit of a re-write, each line would need to be turned into $+() with $str($chr(32),N) inside etc.



"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Stick that into a text file and /play -e the file.


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
ah good call, although i'd go for /loadbuf -a as it resembles /echo's behavior of printing to the active window ;P


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Mar 2007
Posts: 218
V
vexed2 Offline OP
Fjord artisan
OP Offline
Fjord artisan
V
Joined: Mar 2007
Posts: 218
Everything is correct and present in the folder, IE: names.txt exists with the stuff inside
still i get * /play: cannot play to this window (line 12, script7.ini)
* /loadbuf: unable to open file 'C:\merk\names.txt' (line 12, script7.ini)

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Show the commands you're using.


Invision Support
#Invision on irc.irchighway.net
Joined: Mar 2007
Posts: 218
V
vexed2 Offline OP
Fjord artisan
OP Offline
Fjord artisan
V
Joined: Mar 2007
Posts: 218
Code:
Raw 366:*:{ joinsync $2 | haltdef }

alias joinsync {
  loadbuf -a $mircdirnames.txt

Joined: Mar 2008
Posts: 24
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Mar 2008
Posts: 24
loadbuf -a $mircdir $+ names.txt

In this case you dont even need to include $mircdir. Its the default path.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
loadbuf $mircdirnames.txt is valid

$mircdirANYTHING gets translated to C:\mirc'sdir\ANYTHING

you should use $scriptdir though, not $mircdir

$scriptdir is the directory the script file youre currently executing lives

$mircdir is the directory of mirc (or the user's appdata dir)

These are not always the same, specifically if you package/run a script and its loaded from C:\notmirc\somedirectory\yourscript.mrc because it would attempt to still load your packaged "names.txt" from mirc's home directory rather than "C:\notmirc\somedirectory" where it probably resides after unpackaging.

This isn't only a script distribution issue, but can affect you too, say, if you store your scripts inside a "scripts\" subdirectory in mirc, don't be surprised if you arent pointing to the right file anymore.

---------

bottom line: mIRC doesn't lie.. if it says the file does not exist, you're the one who's wrong smile -- double and triple check you're actually pointing to the right filename-- a change to $scriptdir might actually point it to the right place (but not necessarily)

type //echo -a $exists(C:\merk\names.txt)

If that's $false, it's definitely not there-- type /run C:\merk and go check for yourself..


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Mar 2008
Posts: 24
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Mar 2008
Posts: 24
Originally Posted By: argv0
loadbuf $mircdirnames.txt is valid

$mircdirANYTHING gets translated to C:\mirc'sdir\ANYTHING



/loadbuf -a $mircdirtesting.txt

* /loadbuf: unable to open 'C:\Troy\mIRC\$mircdirtesting.txt'

Edit: Ooops my mistake. Need to do //loadbuf from command line.

Last edited by tparry; 28/03/08 02:39 AM.
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
That's because you ran that from the command-line with only a single / at the start, so $mircdir wasn't evaluated.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Mar 2007
Posts: 218
V
vexed2 Offline OP
Fjord artisan
OP Offline
Fjord artisan
V
Joined: Mar 2007
Posts: 218
Thanks dude. grin

It was $false
Strangely though, It was to do with Vista and those rascal roaming folders again lol cheers though much appreciated


Link Copied to Clipboard