Search found 7 matches

by Grapefruits
30 Aug 2018 16:46
Forum: DOS Batch Forum
Topic: Help with a Batch Macro
Replies: 1
Views: 2212

Help with a Batch Macro

Hey everyone. So right now, I have a Batch macro "with arguments", of which I took the form from https://www.dostips.com/forum/viewtopic.php?f=3&t=2518. The macro is this: set ac=^<^> set MUSIC=for /L %%n in (1 1 2) do if %%n==2 (%\n% for /F "tokens=1 delims=, " %%1 in ("!argv!") do (%\n% set "argum...
by Grapefruits
31 Jul 2018 15:09
Forum: DOS Batch Forum
Topic: Strange behavior in Batch script
Replies: 2
Views: 2571

Strange behavior in Batch script

So I have this script. It's supposed to check if the input (%skiller%) is in the variable %tree%. So if I input Sword, it'll look for the string "Sword" in the variable %tree%. The tree value is "Sword Shield". Afterward, it checks the variable %skillsunlocked% to see if it has the input. If it has ...
by Grapefruits
28 Jun 2018 08:53
Forum: DOS Batch Forum
Topic: Double expansion ? Trouble expanding a variable inside another variable and displaying it
Replies: 5
Views: 4582

Re: Double expansion ? Trouble expanding a variable inside another variable and displaying it

@aGerman I thought OsmiumProgramming's question asked if entering a variable name with the percent signs around it in the set /p statement would expand to its contents. So if you enter %var% in the set /p statement, it would expand to its contents (so 4). If you enter %var% in set /p using my code i...
by Grapefruits
27 Jun 2018 19:26
Forum: DOS Batch Forum
Topic: Double expansion ? Trouble expanding a variable inside another variable and displaying it
Replies: 5
Views: 4582

Re: Double expansion ? Trouble expanding a variable inside another variable and displaying it

This is coming from a total beginner in batch, but what I think you can do is put "call" before echo, to call the variable when its put out. Like this: set var=4 set /p a= call echo %a% So it puts out 4 So that by putting in %var%, and calling echo a (which equals %var%) it'll expand it and print ou...
by Grapefruits
27 May 2018 17:47
Forum: DOS Batch Forum
Topic: How does this colour Batch script work?
Replies: 4
Views: 4704

Re: How does this colour Batch script work?

Thanks for the reply!
Instead of outputting the whole range of colours, could it output one specific colour?
So say I wanted just rgb(42, 51, 66), how would I invoke that? Sorry if I sound ignorant, I'm just curious on how it works.
by Grapefruits
27 May 2018 11:54
Forum: DOS Batch Forum
Topic: How does this colour Batch script work?
Replies: 4
Views: 4704

How does this colour Batch script work?

Sorry for the broad question. I was browsing Dostips when I came across this code in https://www.dostips.com/forum/viewtopic.php?f=3&t=6839&p=56613&hilit=batch+rgb#p56613 @echo off & setlocal enabledelayedexpansion mode 90,60 for /F %%a in ('echo prompt $E^| cmd') do set "ESC=%%a" Set /a s=10000, v1...