
sergeyWolf
Active Members-
Posts
39 -
Joined
-
Last visited
Everything posted by sergeyWolf
-
suggestion Func _MouseMove($iX, $iY, $speed = 1) Local $x1 = MouseGetPos(0) Local $y1 = MouseGetPos(1) Local $di = Round (Sqrt (Abs ($iX - $x1) + Abs ($iY - $y1))) ; add diagonal ;ConsoleWrite ("diagonal = "& $di &@CR) Local $xv = Random (-100, 100) Local $yv = Random (-100, 100) Local $sm = Random (1.5, 2.5) Local $m = Random (50, 160) Local $ci, $co, $cx, $cy If $di > 5 Then ; if diagonal big then animation ;ConsoleWrite ("diagonal >"& $di &@CR) For $i = 0 To $m $ci = _AnimEaseInOut($i / $m, $sm) $co = _AnimEaseBackward($i / $m, $sm) $cx = $x1 + (($iX - $x1) * $ci) + ($xv * $co) $cy = $y1 + (($iY - $y1) * $ci) + ($yv * $co) MouseMove ($cx +Random (-1, 1), $cy +Random (-1, 1), $speed) Next Else ; else move straight to place ;ConsoleWrite ("diagonal < "& $di &@CR) MouseMove ($iX +Random (-1, 1), $iY +Random (-1, 1), 5) EndIf _MouseMoveIdle() ; move random times to random places near poit EndFunc Func _MouseMoveIdle () Local $x1 = MouseGetPos (0) Local $y1 = MouseGetPos (1) Local $ju = Random (1, 5) For $i = 0 To $ju MouseMove ($x1 + Random (-5, 5), $y1 + Random (-5, 5), 5) Next EndFunc diagonal need to be checked otherwise we "dancing around coord" (try to start loop in one coord, mouse start dancing around it) _MouseMoveIdle() - random times jump to random coord near end point
-
i get an error when trying _XMLNodeExists ("/data/client/123_asdf/group") why? error msg like : Предпологается NodeTest, /data/cleint/--->123<---_asd/group, неопознанная ошибка, err.number 80020009, scriptline 1733 something like that btw when i try check node with name "asdf_123" got no error, why if i put number first == error?
-
$GUI_log = GUICreate ("Log of actions", 400, 700, -1, -1, -1, -1, $GUI_main) GUISetState (@SW_HIDE, $GUI_log) i need some like If GUICtrlGetState ($GUI_coord) = @SW_SHOW Then ; ..something happen,, EndIf ps: this example doesn't work
-
main idea : script launch several GUIs. if we close child window - it will close, if we close main GUI window - will close main window + all other GUIs (windows) i tried to play with it by "@SW_SHOW\@SW_HIDE" but can't understand how to make it work properly my current file #include <GuiConstants.au3> #include <WindowsConstants.au3> Local $GUI_main Local $main_action Local $GUI_log Local $log_action Local $GUI_edit Local $edit_action $GUI_main = GUICreate ("Main", "300", "300", -1, -1) $bt_open_log = GUICtrlCreateButton ("New window", 10, 10, 100, 50) GUISetState (@SW_SHOW) $GUI_log = GUICreate ("Log", "200", "200", -1, -1) $bt_hide_log = GUICtrlCreateButton ("hide", 10, 10, 100, 50) GUISetState (@SW_SHOW) $GUI_edit = GUICreate ("Edit", "200", "200", -1, -1) $bt_hide_edit = GUICtrlCreateButton ("hide", 10, 10, 100, 50) GUISetState (@SW_SHOW) While 1 $main_action = GUIGetMsg() $log_action = GUIGetMsg () $edit_action = GUIGetMsg () Select Case $main_action = $GUI_EVENT_CLOSE ExitLoop Case $log_action = $GUI_EVENT_CLOSE GUISetState (@SW_HIDE, $GUI_log) Case $edit_action = $GUI_EVENT_CLOSE GUISetState (@SW_HIDE, $GUI_edit) EndSelect WEnd
-
thnx i'll try got another question how to get properly all atributes and their values of node? for example we got <?xml version="1.0"?> <data> <item attr1="1" attr2="2" attr3="3"/> </data> need to get all attributes of "item" can't find necessary function to use
-
Best way for storage data (arrays) in file.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
<?php for ($i = 0; $i < get_user_counter(); $i++) { $user["name"][$i] = get_item(); } function get_user_counter() { return sql_query(); # return INT } function get_item() { $_data = sql_query(); # return array foreach ($_data as $k => $v) { if ($k == "blueprint") { $_data[]["bpo_list"] = get_details_list(); } } return $_data; } function get_details_list() { $_details = sql_query(); #return array foreach ($_details as $k => $v) { if ($k == "blueprint") { $_details[]["bpo_list"] = get_parts_list(); } } return $_details; } function get_parts_list() { $_parts = sql_query(); #return array foreach ($_parts as $k => $v) { if ($k == "blueprint") { $_parts[]["bpo_list"] = get_mineral_list(); } } return $_parts; } function get_mineral_list() { $_mineral = sql_query(); foreach ($_mineral as $k => $v) { $_price = get_price($k); if ($_price) { $_mimeral[]["mineral_price"] = $_price; } } return $_mineral; } ?> and now imagine 498573297 people manufacturing different cars or planes ps: i didn't post sql_query () and results if you can't understand this example - not my problems, that's all i left sleep my time is 04:56, **cking examples -
Best way for storage data (arrays) in file.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
i'll post special for you both example from php, there are NOT 2d\3d arrays you will a little bit later -
Best way for storage data (arrays) in file.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
solution founded, can be closed WBR Sergey -
just start use wrapper and got "Variable used without being declared." code below #Include <_XMLDomWrapper.au3> Opt ('MustDeclareVars', 1) Local $_xml_path = @DesktopDir&"\newXML.xml" Local $_node_root = "data" If Not FileExists ($_xml_path) Then _XMLCreateFile ($_xml_path, $_node_root, True) EndIf Local $_xml_open = _XMLFileOpen ($_xml_path) _XMLCreateRootChild ("icon", "" , "") _XMLCreateRootChild ("name", "" , "") ;_XMLCreateChildNode($_node_root&"/icon","GroupNumber",$x,"") ; create children by index Local $name[3] $name[0] = "nameJone" $name[1] = "nameEmmy" $name[2] = "nameMickel" For $x = 1 to 3 _XMLCreateChildNode ($_node_root&"/icon","start", $name[$x-1], "327469283754string275462756") Next ;Local $aNames[3]=["Matthew","Abigail","Olivia"] ;For $x =1 to 3 ;_XMLCreateChildWAttr ($root&"/Group[2]", "some"&$x, "attribute", "value", "stringdata" ) ;_XMLCreateAttrib ( $root&"/Group[2]/some"&$x, "newattribute", "newvalue") ;_XMLCreateAttrib ( $root&"/Group[2]/some"&$x, "newattribute123", "newvalue") ;Next $_xml_open =0 Exit i took "Ready example" and start play with it after one option (Opt ('MustDeclareVars', 1)) script stoped error msg >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\__sergey\autoit\temp.au3" _XMLCreateRootChild:icon C:\Program Files (x86)\AutoIt3\Include\_XMLDomWrapper.au3 (1671) : ==> Variable used without being declared.: $objFormat = $objDoc.createTextNode (@CR) ^ ERROR >Exit code: 1 Time: 0.359 is there quick fix? or wait new version? ps: don;t want change by myself something in foreign code
-
Best way for storage data (arrays) in file.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
in php i used about 4-7 in deep something like this (just in general to show where i use it) $user["user_name1"]=>"id1"=>"itemName1"=>"detail1"=>"construction_part1"=>"mineral1"=>"price1" $user["user_name1"]=>"id1"=>"itemName1"=>"detail2"=>"construction_part1"=>"mineral2"=>"price2" and so go on... each part of array can be different, some empty \ some up to 20 it's an array of manufacturing items (for game calculation) unfortunately now this arrays would be replaced by xml ps: example taken from php, i will not rewrite properly for autoit syntax -
Best way for storage data (arrays) in file.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
xml easier, and i already saw it can store as i need SQLite (as i think) for huge projects\programs, not my situation, i need simply store huge arrays and read them anyway thnx, it's a another way -
Best way for storage data (arrays) in file.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
yep, founded, thnx -
Best way for storage data (arrays) in file.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
i show just example (autoit didn't can such arrays? О.о i didn't knew), i hope every1 understood what i meant and yes, thnx xml would be best way, but in help there is not info about xml at all ps: i'm not know in autoit as you can see, so sorry by such examples -
Currently i store in .ini files but they can't save too deep arays. What i'm talk about - for example we got array $example[10][10][10][10]. Ini files have just "section"=>"key"=>"value", but we got deeper array. Is there another way to store such arrays? (i don't want write special fuctions and store it in txt files)
-
example #include <Constants.au3> #include <GuiConstants.au3> #include <GuiConstantsEx.au3> #include <GuiListView.au3> Opt('MustDeclareVars', 1) Local $main_GUI, $main_listView $main_GUI = GuiCreate ("Sample GUI", 400, 400) GuiSetIcon (@SystemDir & "\mspaint.exe", 0) $main_listView = GuiCtrlCreateListView ("", 10, 10, 380, 200) _GUICtrlListView_AddColumn ($main_listView, "time", 100) _GUICtrlListView_AddColumn ($main_listView, "description", 100) _GUICtrlListView_SetColumnWidth ($main_listView, 1, $LVSCW_AUTOSIZE_USEHEADER) GuiCtrlCreateListViewItem ("A|One", $main_listView) GuiCtrlCreateListViewItem ("B|Two", $main_listView) GuiCtrlCreateListViewItem ("C|Three", $main_listView) _GUICtrlListView_SetBkColor ($main_listView, $CLR_BLACK) _GUICtrlListView_SetTextColor ($main_listView, $CLR_WHITE) _GUICtrlListView_SetTextBkColor ($main_listView, $CLR_MONEYGREEN) GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd as you can see every row got a little margin from left side, how to disable\change it ?
-
hm, so got another question how to load .png image to _GUIImageList_Create() (need PNG because of background color, under image) ? i tried use icons.au3 UDF but can't understand how to use it what i currently've got #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <WindowsConstants.au3> #include <D:\Icons.au3> Opt ('MustDeclareVars', 1) Local $main_gui, $main_action, $main_view Local $hImage $main_gui = GUICreate ("main gui", 400, 300) $main_view = GUICtrlCreateListView ("", 0, 150, 400, 150) ; Enable extended control styles GUISetState(@SW_SHOW) ; Load images $hImage = _GUIImageList_Create() _GUIImageList_AddBitmap ($hImage, _SetImage("", "n.PNG", 0)) _GUIImageList_AddBitmap ($hImage, "y.bmp") _GUICtrlListView_SetImageList($main_view, $hImage, 1) _GUICtrlListView_SetBkColor ($main_view, 0x222222) ; Add columns _GUICtrlListView_AddColumn($main_view, "Time", 100) _GUICtrlListView_AddColumn($main_view, "Action", 100) ; Add items _GUICtrlListView_AddItem ($main_view, "Row 1: Col 1", 0) _GUICtrlListView_AddItem ($main_view, "Row 1: Col 1", 2) _GUICtrlListView_AddSubItem ($main_view, 0, "Row 1: Col 2", 1, 1) _GUICtrlListView_AddItem ($main_view, "Row 2: Col 1", 1) While True $main_action = GUIGetMsg() Switch $main_action Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd
-
sorry founded, my bad _GUIImageList_AddIcon and _GUIImageList_AddBitmap
-
here is example #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> Opt ('MustDeclareVars', 1) Local $main_gui, $main_action, $main_view Local $hImage $main_gui = GUICreate ("main gui", 400, 300) $main_view = GUICtrlCreateListView ("", 0, 150, 400, 150) ; Enable extended control styles GUISetState(@SW_SHOW) ; Load images $hImage = _GUIImageList_Create() _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($main_view, 0xFFFFFF, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($main_view, 0xFF0000, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($main_view, 0x00FF00, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($main_view, 0x0000FF, 16, 16)) _GUICtrlListView_SetImageList($main_view, $hImage, 1) ; Add columns _GUICtrlListView_AddColumn($main_view, "Time", 100) _GUICtrlListView_AddColumn($main_view, "Action", 100) ; Add items _GUICtrlListView_AddItem ($main_view, "Row 1: Col 1",3) _GUICtrlListView_AddSubItem ($main_view, 0, "Row 1: Col 2", 1, 1) _GUICtrlListView_AddItem ($main_view, "Row 2: Col 1",2) While True $main_action = GUIGetMsg() Switch $main_action Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd part of it is from help docs i can't understand how to set image or icon pls help whith "edited" example
-
How to stop\break Func immediately.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
i hoped to find some "magical" options for that or function not important, i think to use your solution WBR sergey -
How to stop\break Func immediately.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
oh, i see really **cks it's seems like butthurt thnx eveyone anyway -
How to stop\break Func immediately.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
ok, working script, untill shift+alt+p not pressed - will run MsgBox Global $checker = 1 HotKeySet("+!p", "break_all") Func break_all () $checker = Not $checker EndFunc Func make_one_one () If $checker Then MsgBox (0, "one one", "text one one") EndIf EndFunc Func make_one () If $checker Then MsgBox (0, "one", "text one") EndIf If $checker Then make_one_one () EndIf EndFunc Func general () If $checker Then make_one () EndIf If $checker Then general () EndIf EndFunc general () and again question how do the same without If $checker Then ; some code EndIf -
How to stop\break Func immediately.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
so you propose this?Global $checker = 0 HotKeySet("+!p", "break_all") Func break_all () $checker = Not $checker EndFunc Func make_one_one () If $checker Then ; some others EndIf EndFunc Func make_one () If $checker Then MsgBox (0, "one", "text one") EndIf If $checker Then make_one_one () EndIf EndFunc Func general () If $checker Then make_one () EndIf If $checker Then general () EndIf EndFunc -
How to stop\break Func immediately.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
how? example pls, i know how to make pause of script but then it will start from the place of pause -
How to stop\break Func immediately.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
I try to avoid it -
How to stop\break Func immediately.
sergeyWolf replied to sergeyWolf's topic in AutoIt General Help and Support
mmm... copy-paste not working? lol, missed "()" at first string of general function (code already edited) need something like exit\exitloop fo a Funcor exit\stop currently launched functions (without exiting of GUI and programm in general) if i'll make statement which will check every time - it would be too ***cking big space of code (i'd wish they make OOP in autoit =\) recursion not working? mmm... really? it's work fine for me