Aktonius Posted April 20, 2011 Share Posted April 20, 2011 I tried something like using a function from include and inside that function i define $variable which later i try to use within main script but it doesnt recognize the variable. What would be the right procedure so variable defined somewhere in include file's function is recognized within main script? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 20, 2011 Moderators Share Posted April 20, 2011 Aktonius, It is bad coding practice to try to use variables from within includes in your main script. The whole idea of includes is that they are self-contained and can be used in different scripts. You should get the include to pass the value of the variable as the return value from the function defined within the include. Perhaps if you posted the essential parts of the include and the script we could show you how you might do this. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Aktonius Posted April 20, 2011 Author Share Posted April 20, 2011 (edited) Melba i am aware of this but i am trying to add some security check for a script that should pay off some hard work i did I am just trying to add few extra blocks of security, its bad coding practice but it helps If include file gets broken/removed by a crackingkid my main script would break down as well Edited April 20, 2011 by Aktonius Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 20, 2011 Moderators Share Posted April 20, 2011 Aktonius,If include file gets broken/removed by a crackingkid my main script would break down as wellHow does a "crackingkid" get to "break/remove" an include? If you have all the files in .au3 format the security you get from your scheme will be trivial. If you have compiled the file the include files are (as the name suggests) already included and I do not see how this adds any security at all. Could you explain a little further? M23P.S. Love the term "crackingkid", by the way. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Aktonius Posted April 20, 2011 Author Share Posted April 20, 2011 (edited) hehe, well Usually those crackingkids will just reove some function calls with debugger like Olly etc.. If i could add some variables in those functions that later my script would check call for then that job wouldnt do much good for them. Understand now? Example you put in a value in a variable that only you know, later your script will check for that value randomly, if it doesnt exist(means the seccurity function didnt finish) boom, bye bye Edited April 20, 2011 by Aktonius Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 20, 2011 Moderators Share Posted April 20, 2011 Aktonius,If you want a variable from a function within an include to be recognised outside the include, just define it as Global. You might get a warning from Au3Check about it, but it will work. Just make sure you give it a sufficiently unique name that it will not interfere with any other Global variable. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Aktonius Posted April 21, 2011 Author Share Posted April 21, 2011 Ok, thanks for the help, can you suggest some way to exit a script without just exit macro I figure it would mess up thing bit more Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 21, 2011 Moderators Share Posted April 21, 2011 Aktonius, can you suggest some way to exit a script without just exit macroIf I had the slightest idea what you meant I might! Do you mean exit without looking for a $GUI_EVENT_CLOSE event? If so then just use any old event to exit - for example this will exit if you click the minimize button or release the right mouse button: #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_MINIMIZE, $GUI_EVENT_SECONDARYUP Exit EndSwitch WEnd Or have I got completely the wrong end of the stick? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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