Jump to content

Help me with this


Recommended Posts

Hello i trying to make a program to do this for me.

<Entry>
                <R> 0.1 </R>
                <G> 0.</G>
                <B> 0. </B>
                <A> 1.0 </A>
            </Entry>
            <Entry>
                <R> 0.2 </R>
                <G> 0.</G>
                <B> 0. </B>
                <A> 1.0 </A>
            </Entry>
            <Entry>
                <R> 0.3 </R>
                <G> 0.</G>
                <B> 0. </B>
                <A> 1.0 </A>
            </Entry>
            <Entry>
                <R> 0.4</R>
                <G> 0.</G>
                <B> 0. </B>
                <A> 1.0 </A>
            </Entry>
            <Entry>
                <R> 0.5 </R>
                <G> 0.</G>
                <B> 0. </B>
                <A> 1.0 </A>
            </Entry>
            <Entry>
                <R> 0.6 </R>
                <G> 0.</G>
                <B> 0. </B>
                <A> 1.0 </A>
            </Entry>

All up to 1 and then go to 0 and start to do the same thing to Colum G.

Until it got all variation of R, G and B

Haven't manage to do this tho.. here is my script.. i cant make it start on the G and it just keep counting past number 1.

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.6.0
 Author:         Omen

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
Dim $Nextname = 0 ;Start/Stop
Dim $R = 0
Dim $G = 0
Dim $B = 0
HotKeySet("{end}", "Button");On/Off
HotKeySet("{F7}", "MyExit");Exit

While 1

    Select
          Case $Nextname = 1
        $R = $R + 0.1
        $G = $G
        $B = $B
        Send("<Entry>{Enter} <R>  "& $R & " </R>{Enter} <G> "& $G & " </G>{Enter} <B> "& $B & " </B>{Enter} <A> 1.0 </A>{Enter}         </Entry>{Enter}")
 If $R = 1 then
   $G = $G + 0.1
   $R = 0
  ElseIf  $G = 1 then
  $B = $B + 0.1
  $G = 0
  ElseIf  $B = 1 then
  $G = 0
  $R = 0
  $G = $G + 0.1
  
Endif
    EndSelect
    Sleep(1)
    
WEnd

Func Button()
    
    Select
    Case $Nextname = 0
        $Nextname = 1
        
    Case $Nextname = 1
        $Nextname=0
        
    EndSelect
    
EndFunc

Func MyExit()

    Exit
    
EndFunc

Thanks for the help in advance

Link to comment
Share on other sites

hey you could do it like this, a inner loop to count from 0 to 1 in inc of 0.1 and an outer loop to control which position it applys the inc to.

$sString = ""

For $i2 = 1 to 3
$sString &= "<Entry>" & @CR
For $i = 0 To 1 Step 0.1
    $sString &= "<R> "
    If $i2 = 1 Then
        $sString &= $i
    Else
        $sString &= 0
    EndIf
    $sString &= " </R>" & @CR & "<G> "
    If $i2 = 2 Then
        $sString &= $i
    Else
        $sString &= 0
    EndIf
    $sString &= " </B>" & @CR & "<B> "
    If $i2 = 3 Then
        $sString &= $i
    Else
        $sString &= 0
    EndIf
    $sString &= " </B>" & @CR & "<A> 1.0 </A>" & @CR & "</Entry>" & @CR
Next
Next

ConsoleWrite($sString)
GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.
Link to comment
Share on other sites

Here you go.

$file = FileOpen("Out.txt",2)

for $B = 0 to 1 step 0.1
    for $G = 0 to 1 step 0.1
        for $R = 0 to 1 step 0.1
            
            FileWrite($file,"<Entry>" & @CRLF & @TAB & "<R>" & $R & "</R>"  & @CRLF & @TAB & "<G>" & $G & "</G>"  & @CRLF & @TAB & "<B>" & $B & "</B>"  & @CRLF & @TAB & "<A>1.0</A>"  & @CRLF &  "</Entry>" & @CRLF)
            
            
        Next
    Next
Next

FileClose($file)

changed code bracket to autoit :idea: (Also whoops) :)

Edited by hawky358
Link to comment
Share on other sites

Here you go.

$file = FileOpen("Out.txt",2)

for $B = 0 to 1 step 0.1
    for $G = 0 to 1 step 0.1
        for $R = 0 to 1 step 0.1
            
            FileWrite($file,"<Entry>" & @CRLF & @TAB & "<R>" & $R & "</R>"  & @CRLF & @TAB & "<G>" & $G & "</G>"  & @CRLF & @TAB & "<B>" & $B & "</B>"  & @CRLF & @TAB & "<A>1.0</A>"  & @CRLF &  "</Entry>" & @CRLF)
            
            
        Next
    Next
Next

FileClose($file)

changed code bracket to autoit :idea: (Also whoops) :)

This is more my kind of coding.. tho i already got it to work... kinda.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...