Jump to content

Maxel

Members
  • Posts

    6
  • Joined

  • Last visited

Maxel's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hello, i know there is probably another post quite like this with all the answers inside in this forum, but before you flame now plz consider that i searched now for like an hour without finding it :/. My tests havent brought me any further either. So here is my Question. Is it possible to declarate Variables with using for ? Like Arrays or such here the Wrong Version so it might be better understood: WRONG: for $i = 1 to 10 global $array{$i}[1] next Now i DONT want to make a 2dim Array since the ubound function dosent seem to work with more than 2dim and i thought well i make 6 2dim arrays out of my 1 3dim one. So if anyone could help me with a quick tip i would appreciate that! Thx in Advance greetz Max edit: Ok then i cant explain the error but nevertheless the first question would help to automate the thing for different problems so an answer would be nice anyway heres the not working code ( plz dont hit me i know i'm quite bad ^^ and havent commented :/ ) edit 2: the error... Stage 1 Complete E:downloadsProgrammeautoitscriptsPixeltest.au3 (40) : ==> Error in expression.: for $x 0 to (ubound($array,3)-1) for $x 0 ^ ERROR >Exit code: 1 Time: 9.008 edit 3: i'M stupid ... forgot the = .... might solve the problem ^^ anyway still corious about the first question edit 4: now i'm getting this error :/ Any Tips ( since i have that post already ^^ ) Stage 1 Complete E:downloadsProgrammeautoitPixeltest.au3 (45) : ==> No variable given for "Dim", "Local", "Global", "Struct" or "Const" statement.: redim($it12[$k]) redim^ ERROR >Exit code: 1 Time: 8.607 heres the original - with repeatable variable declaration i could caugh the lower block together.. tried fast some explaining comments but since it was just a try if it would work i havent been true with commenting #include <Array.au3> #include<File.au3> HotKeySet("{f1}", "pixel") Global $array[6][3][144] Global $It12[1] Global $It13[1] Global $It14[1] Global $It15[1] Global $It16[1] while 1 sleep(500) wend func pixel() ; some fast comments here $x=555 ; x y position where pixelcheck shall start $y=359 for $k=0 to 2 ; creating 3dim array with hex checksums for $i=0 to 5 for $j=0 to 23 $array[$i][$k][$j]=hex(PixelGetColor($x+27*$i+$j ,$y+$k)) next Next Next ConsoleWrite("Stage 1 Complete") ; reminder for console to see if it rly runs ;) $z=0 ; now i want to check for duplicates ( the goal is to get pixel's which are in all 6 ( first dimension of the array ) Groups ! for $y = 0 to (ubound($array,2)-1) for $x =0 to (ubound($array,3)-1) for $y2 = 0 To (ubound($array,2)-1) for $x2 = 0 To (ubound($array,3)-1) if $array[$z][$x][$y] = $array[$z+1][$x2][$y2] Then $k=ubound($it12)-1 redim($it12[$k]) $It12[$k]=$array[$z][$x][$y] EndIf Next Next Next Next ConsoleWrite("Stage 2 Complete") $z=1 for $x = 0 to (ubound($It12)-1) ; Checking the IT12 array against the second Group the rest is the same for $y2 = 0 To (ubound($array,2)-1) for $x2 = 0 To (ubound($array,3)-1) if $It12[$x] = $array[$z+1][$x2][$y2] Then $k=ubound($item13)-1 redim($it13[$k]) $It13[$k]=$It12[$x] EndIf Next Next Next ConsoleWrite("Stage 3 Complete") $z=2 for $x = 0 to (ubound($Item13)-1) for $y2 = 0 To (ubound($array,2)-1) for $x2 = 0 To (ubound($array,3)-1) if $It13[$x] = $array[$z+1][$x2][$y2] Then $k=ubound($it14)-1 redim($it14[$k]) $It14[$k]=$It13[$x] EndIf Next Next Next ConsoleWrite("Stage 4 Complete") $z=3 for $x = 0 to (ubound($Item14)-1) for $y2 = 0 To (ubound($array,2)-1) for $x2 = 0 To (ubound($array,3)-1) if $It14[$x] = $array[$z+1][$x2][$y2] Then $k=ubound($it15)-1 redim($it15[$k]) $It15[$k]=$It14[$x] EndIf Next Next Next ConsoleWrite("Stage 5 Complete") $z=4 for $x = 0 to (ubound($Item15)-1) for $y2 = 0 To (ubound($array,2)-1) for $x2 = 0 To (ubound($array,3)-1) if $It15[$x] = $array[$z+1][$x2][$y2] Then $k=ubound($it16)-1 redim($it16[$k]) $It16[$k]=$It15[$x] EndIf Next Next Next for $i = 0 to (ubound($It16)-1) ConsoleWrite($It16[$i] & @LF) next #cs old version for output before i found redim $string = "" $string2 = "" For $i = 0 To UBound($array) - 1 $o="a" $p=0 For $j = 0 To UBound($array, 2) - 1 $z=$j-24*$p $string &=( "$array[" & $i & "][" & $z & $o &"] = " & $array[$i][$j] & @LF) $string2 &=( $array[$i][$j] & @LF) if $z>22 Then $p=$p+1 if $p=1 Then $o="b" elseif $p=2 Then $o="c" elseif $p=3 Then $o="d" elseif $p=4 Then $o="e" elseif $p=5 Then $o="f" elseif $p=6 Then $o="g" EndIf EndIf Next Next $hFile = FileOpen(@ScriptDir & "2DArray.txt", 2) FileWrite($hFile, $string) FileClose($hFile) $hFile2 = FileOpen(@ScriptDir & "test.txt", 2) FileWrite($hFile2, $string2) FileClose($hFile2) #ce endfunc
  2. Ok its finished for me can be closed ! Found some options in the VM-Ware to help me along
  3. So i need to add the offset after all to every mouseclick. Sigh too bad ^^ hoped autoit had such function inbuild. Thx for the fast answers greetz
  4. I'm running a Vm on my second monitor and want to use some old scripts in it but ran from the main system. And so i had the problem with the cords which get deduced from the main resolution... thats why i thought i might be able to set a new 0 point and thus get around writing the stuff anew. Lookin in the autoit help now thx in advance greetz edit: I know my Desktop Reolutions pretty well... dosent help me to set them for Autoit... I rly dont want to change the running scripts so the question stands if i just can tell autoit i shall use the second monitor and ignore the first one ? Or start counting from the second one thus making the old x/y 1920/0 to a 0/0 for the future reference ( such as mouseclick ect ).
  5. Hello, I was wondering if it is possible to define the Start Point from which the Pixels get counted... The Problem is i got 2 Screens and want to execute the Script on the Second Screen with its native Resolution... so i thought maybe there is a function where i can set the 0 Point to the right side and dont have to change EVERY cord ( which are quite some ). Thx in Advance ( and i know an offset might have done the Prob for me ! ). greetz Max
  6. Hello Guys, I'm trying to hook Autoit to an Subwindow and i'm not getting there. I'm using VMware to create an Vm. Now i want to send Autoit commands in the new Windows, which is created. Now VMware opens a greater Window, in which the Windows Window is only a part ( some options lists ect on the left Side ). The only different attribute those windows have is the Class under Control. Anyone knows how i can Access that so i just have the "native" Pixels from my VM ? Any help appriciated!Here the whole Summary of the Window Info : Window i want to use: ( the 800x600 one if its possible ) >>>> Window <<<< Title: Testserver - VMware Workstation Class: VMUIFrame Position: 155, 276 Size: 1020, 754 Style: 0x16CF0000 ExStyle: 0x00000100 Handle: 0x00000000000317E0 >>>> Control <<<< Class: MKSEmbedded Instance: 1 ClassnameNN: MKSEmbedded1 Name: Advanced (Class): [CLASS:MKSEmbedded; INSTANCE:1] ID: Text: M Position: 202, 94 Size: 800, 600 ControlClick Coords: 300, 357 Style: 0x50000000 ExStyle: 0x00000000 Handle: 0x00000000000118DC >>>> Mouse <<<< Position: 665, 757 Cursor ID: 0 Color: 0x106FCC >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< vmFullScreenUnibar M Testserver >>>> Hidden Text <<<< Exit Unity Help With Using Unity thx in advance Max edit: If any one can tell me how i get the second handle that would help alot too ( haven't used handles yet but they seem to be way better! )
×
×
  • Create New...