I have this exceedingly ugly batchfile...
Anyone got any ideas? I don't remember having to do anything like this before, and offhand can't come up with a better idea.
I have this exceedingly ugly batchfile...
random errorlevel
if errorlevel 1 copy \goodbye\5.ans \sbbs\txt\goodbye.ans
if errorlevel 2 copy \goodbye\4.ans \sbbs\txt\goodbye.ans
if errorlevel 3 copy \goodbye\3.ans \sbbs\txt\goodbye.ans
if errorlevel 4 copy \goodbye\2.ans \sbbs\txt\goodbye.ans
if errorlevel 5 copy \goodbye\1.ans \sbbs\txt\goodbye.ans
if errorlevel 6 copy \goodbye\6.ans \sbbs\txt\goodbye.ans
if errorlevel 7 copy \goodbye\7.ans \sbbs\txt\goodbye.ans
if errorlevel 8 copy \goodbye\8.ans \sbbs\txt\goodbye.ans
if errorlevel 9 copy \goodbye\9.ans \sbbs\txt\goodbye.ans
SET /a anum=(%RANDOM%*10/32768)+1 copy \goodbye\%anum%.ans \sbbs\txt\goodbye.ans
SET /a anum=(%RANDOM%*10/32768)+1
SET /a anum=(%RANDOM%*10/32768)+1 copy \goodbye\%anum%.ans \sbbs\txt\goodbye.ans
random errorlevel if errorlevel 1 copy \goodbye\5.ans
I'm not sure if you realize it, but "if error level 1" means "if errorlevel is greater or equal to 1". I think you mean to use "if
random errorlevel if errorlevel 1 copy \goodbye\5.ans
I'm not sure if you realize it, but "if error level 1" means "if errorlevel is greater or equal to 1". I think you mean to use "if
SET /a anum=(%RANDOM%*10/32768)+1
This isn't supported, I end up with
set
"/A ANUM=(%RANDOM%*10/32768)+1"
don't mind the quotes, / A is a abort message in my message editor.
SET /a anum=(%RANDOM%*10/32768)+1 copy \goodbye\%anum%.ans \sbbs\txt\goodbye.ans
Didn't know there was one in ANSI.SYS.. means I'll have to load it.. its not presently although it does wonders for display nothing actually
needs it. I'll give it a try see how it goes.
What OS are you running? If I remember right, %RANDOM% should work
in everything from Windows 95 and up, maybe earlier.
Also, not sure what setting a random number to a variable has to do
with ANSI.SYS. =) The example I gave just cleans up the multipart
What OS are you running? If I remember right, %RANDOM% should work
in everything from Windows 95 and up, maybe earlier.
Also, not sure what setting a random number to a variable has to do
with ANSI.SYS. =) The example I gave just cleans up the multipart
On 12-21-19 13:44, Digital Man wrote to Spectre <=-
Re: DOS Batch files
By: Spectre to Somebody on Sat Dec 21 2019 09:04 pm
I have this exceedingly ugly batchfile...
random errorlevel
if errorlevel 1 copy \goodbye\5.ans \sbbs\txt\goodbye.ans
if errorlevel 2 copy \goodbye\4.ans \sbbs\txt\goodbye.ans
if errorlevel 3 copy \goodbye\3.ans \sbbs\txt\goodbye.ans
if errorlevel 4 copy \goodbye\2.ans \sbbs\txt\goodbye.ans
if errorlevel 5 copy \goodbye\1.ans \sbbs\txt\goodbye.ans
if errorlevel 6 copy \goodbye\6.ans \sbbs\txt\goodbye.ans
if errorlevel 7 copy \goodbye\7.ans \sbbs\txt\goodbye.ans
if errorlevel 8 copy \goodbye\8.ans \sbbs\txt\goodbye.ans
if errorlevel 9 copy \goodbye\9.ans \sbbs\txt\goodbye.ans
I'm not sure if you realize it, but "if error level 1" means "if errorlevel is greater or equal to 1". I think you mean to use "if %errorlevel% equ 1" instead.
https://ss64.com/nt/errorlevel.html
On 12-22-19 10:42, Spectre wrote to Digital Man <=-
random errorlevel if errorlevel 1 copy \goodbye\5.ans
I'm not sure if you realize it, but "if error level 1" means "if errorlevel is greater or equal to 1". I think you mean to use "if
Thats the only way I've ever used errorlevels, basic bbs batch file
work, and why the errorlevels are always listed low to high... equal
would certainly cut down the work...
Spectre wrote to Somebody <=-
I have this exceedingly ugly batchfile...
random errorlevel
if errorlevel 1 copy \goodbye\5.ans \sbbs\txt\goodbye.ans
Just FYI, I'm getting a bunch of dupe messages from you :)
I'm not sure what (if anything) changed recently on fsxNet but wanted to flag.
Yep, there are some dupes coming through from him. Avon changed over
to HPT mail tosser, like hub 4 is, and it doesn't remove the soft CRs
like Mystic does...
I recall having to go from high to low, not low to high.
I replaced a similar batch file with a bit of javascript that runs
in the BBS, would this work for you? This code block should do the
Just FYI, I'm getting a bunch of dupe messages from you :)
I recall having to go from high to low, not low to high.
Just FYI, I'm getting a bunch of dupe messages from you :)
I haven't changed anything here, are the messages originating here or messages from somewhere else getting exported again?
Deon, you might want to either only crash to Hub 2, or crash to Hubs 1 & 4... I'm not sure if there is another solution at this point...
Yep, there are some dupes coming through from him. Avon changed over to HPT mail tosser, like hub 4 is, and it doesn't remove the soft CRs like Mystic does...
I haven't seen any dupes (recently) in net 4. My guess is that ryan is seeing th em arrive in net 1 changed via net 2. :(
I just notice a heap go out to Hub 4 (when I re-enabled the filebox) - forgot to remove those - so if they all come in as dupes - Oops sorry :)
But after this one, the dupes should stop - and I'll keep Mystic out of the loop until we know its been fixed.
Sysop: | echicken |
---|---|
Location: | Toronto, Ontario |
Users: | 2,224 |
Nodes: | 6 (0 / 6) |
Uptime: | 15:53:10 |
Calls: | 14,143 |
Files: | 295 |
Messages: | 551,317 |