mIRC Home    About    Download    Register    News    Help

Print Thread
#197033 27/03/08 01:31 PM
V
vexed2
vexed2
V
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.

#197036 27/03/08 01:42 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
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/ }

V
vexed2
vexed2
V
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.
#197041 27/03/08 01:54 PM
Joined: Feb 2006
Posts: 523
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 523
| 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
#197043 27/03/08 01:55 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Stick that into a text file and /play -e the file.

Joined: Feb 2006
Posts: 523
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 523
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
V
vexed2
vexed2
V
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)

#197054 27/03/08 04:21 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Show the commands you're using.

V
vexed2
vexed2
V
Code:
Raw 366:*:{ joinsync $2 | haltdef }

alias joinsync {
  loadbuf -a $mircdirnames.txt

#197072 28/03/08 01:49 AM
T
tparry
tparry
T
loadbuf -a $mircdir $+ names.txt

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

#197073 28/03/08 02:25 AM
Joined: Oct 2003
Posts: 3,641
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,641
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..

T
tparry
tparry
T
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.
#197075 28/03/08 02:39 AM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
That's because you ran that from the command-line with only a single / at the start, so $mircdir wasn't evaluated.

V
vexed2
vexed2
V
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