Xand3r Posted January 6, 2007 Share Posted January 6, 2007 Ok this is what i was thinking about is it possible to use the value of a variable as a autoit script???for ex: $i='msgbox(0 , "" , "lol")'and i want autoit to run it???(maybee it's a noob question, maybee not but.... i gotta know)pls help Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro Link to comment Share on other sites More sharing options...
BALA Posted January 6, 2007 Share Posted January 6, 2007 (edited) I think it is actually possible. I don't know how to do it, but I use something similar in almost all my scripts. Here's an example: expandcollapse popup#include <Misc.au3> #include <GUIConstants.au3> HotKeySet("{F1}", "On") HotKeySet("{F2}", "Off") HotKeySet("{F3}", "Play") HotKeySet("{F4}", "Stop") Global $trigger = 0 Global $score = 0 Global $click = 1 Global $click2 = -1 Dim $Position, $i = 0, $Record[1] Opt("GUIOnEventMode", 1) $mainwindow = GUICreate("BA-AUTO *BETA*", 200, 160) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") $on = GUICtrlCreateButton("On (F1)", 40, 10, 120) GUICtrlSetOnEvent($on, "On") $off = GUICtrlCreateButton("Off (F2)", 40, 40, 120) GUICtrlSetOnEvent($off, "Off") $play = GUICtrlCreateButton("Play (F3)", 40, 90, 120) GUICtrlSetOnEvent($play, "Play") $stop = GUICtrlCreateButton("Stop (F4)", 40, 120, 120) GUICtrlSetOnEvent($stop, "Stop") GUISetState(@SW_SHOW) Func CLOSEClicked() Exit EndFunc Func On() $score = 1 EndFunc Func Off() $score = 0 EndFunc Func Play() $trigger = 1 EndFunc Func Stop() $trigger = 0 EndFunc While 1 While 1 If $score = 1 Then If _IsPressed("01") Then $click = $click + 1 $Position = MouseGetPos() ; <------setting variable $x = $Position[0] ; <--------using it/ setting variable $y = $position[1] ; <--------using it/ setting variable ReDim $Record[$i + 2] $Record[$i] = $x ; <--------using it/ setting variable $Record[$i + 1] = $y ; <-----using it/ setting variable $i += 2 EndIf sleep(10) EndIf If $score = 0 Then ExitLoop EndIf WEnd While 1 If $trigger = 1 Then For $n = 0 to $click $a = $click2 + 1 $b = $click2 + 2 MouseClick("left", $Record[$a], $Record[$b], 1) ; <----Using it $click2 = $click2 + 2 If $n = $click - 2 Then $click2 = -1 $n = 0 EndIf If $trigger = 0 Then ExitLoop EndIf Next EndIf If $trigger = 0 Then ExitLoop EndIf WEnd WEnd Edited January 6, 2007 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
Zedna Posted January 6, 2007 Share Posted January 6, 2007 (edited) $i="msgbox(0 , '' , 'lol')" Run(@AutoItExe & ' /AutoIt3ExecuteLine "' & $i & '"') Note: you must use apostrofes instead of quotes in your command! Edited January 6, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Developers Jos Posted January 6, 2007 Developers Share Posted January 6, 2007 (edited) ... I don't know how to do it, but I use something similar in almost all my scripts.....I think its kinda late for me to understand this one .,........ Edited January 6, 2007 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Xand3r Posted January 6, 2007 Author Share Posted January 6, 2007 tnx and for pc that don't have autoit installed just put the exe there and use it's path instead of the @AutoItExe macro right? Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro Link to comment Share on other sites More sharing options...
BALA Posted January 6, 2007 Share Posted January 6, 2007 (edited) I think its kinda late for me to understand this one .,........ Hey I come up with great things without understanding them!Hence where I got the idea for an electric tooth pick Edited January 6, 2007 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
Zedna Posted January 7, 2007 Share Posted January 7, 2007 tnx and for pc that don't have autoit installed just put the exe there and use it's path instead of the @AutoItExe macro right?It's not neccessary. It will work also in compiled state without AutoIt instaled. See this:@AutoItExe - The full path and filename of the AutoIt executable currently running. For compiled scripts it is the path of the compiled script. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now