Jump to content
BetaLeaf

[Proof Of Concept] Rollbar Error Reporting v0.2

Recommended Posts

Posted (edited)

What is Rollbar?

Rollbar provides real-time error alerting & debugging tools for developers. Learn more about it at https://rollbar.com/product/

Demo: https://rollbar.com/demo/demo/

Screenshot:

Spoiler

image.thumb.png.5c26313057911c5004969e938536a51c.png

Instructions: (RollbarTest.au3)

; Include RollbarSDK
#include "RollbarSDK.au3"

;Turns on ConsoleWrite debugging override.
;Global $Rollbar_Debug=False

; Initialize RollbarSDK with the project's API key.
; Parameters ....:  $__Rollbar_sToken   - [Required] Go to https://rollbar.com/<User>/<ProjectName>/settings/access_tokens/ for your project. Use the token for post_server_item.
_Rollbar_Init("eaa8464a4082eeabd9454465b8f0c0af")

; Write code that causes an error you want to catch, then call

; _Rollbar_Send
; Parameters ....:  $__Rollbar_sErrorLevel      - [Required] Must be one of the following values: Debug, Info, Warning, Error, Critical.
;                   $__Rollbar_sMessage         - [Required] The message to be sent. This should contain any useful debugging info that will help you debug.
;                   $__Rollbar_sMessageSummary  - [Optional] A string that will be used as the title of the Item occurrences will be grouped into. Max length 255 characters. If omitted, Rollbar will determine this on the backend.
_Rollbar_Send("Debug", "This is an debug message. If you received this, you were successful!", "Debug Message")
_Rollbar_Send("Info", "This is a test message. If you received this, you were successful!", "Info Message")
_Rollbar_Send("Warning", "This is an warning message. If you received this, you were successful!", "Warning Message")
_Rollbar_Send("Error", "This is an error message. If you received this, you were successful!", "Error Message")
_Rollbar_Send("Critical", "This is an critical message. If you received this, you were successful!", "Critical Message")
_Rollbar_Send("Info", "This is a test message. If you received this, you were successful!") ;No Message

; Rollbar_Send's helper functions
; Parameters ....:  $__Rollbar_sMessage         - [Required] The message to be sent. This should contain any useful debugging info that will help you debug.
;                   $__Rollbar_sMessageSummary  - [Optional] A string that will be used as the title of the Item occurrences will be grouped into. Max length 255 characters. If omitted, Rollbar will determine this on the backend.
_Rollbar_SendDebug("This is an debug message. If you received this, you were successful!", "Debug Message")
_Rollbar_SendInfo("This is a test message. If you received this, you were successful!", "Info Message")
_Rollbar_SendWarning("This is an warning message. If you received this, you were successful!", "Warning Message")
_Rollbar_SendError("This is an error message. If you received this, you were successful!", "Error Message")
_Rollbar_SendCritical("This is an critical message. If you received this, you were successful!", "Critical Message")

; Usable Example
Local $sImportantFile = "C:\NOTAREALFILE_1234554321.txt"
Switch FileExists($sImportantFile)
    Case True
        MsgBox(0, "Example Script", "An important file was found. Continuing...")
    Case Else
        _Rollbar_SendCritical('An important file was missing. Halting... File: "' & $sImportantFile & '"', 'Important file "' & $sImportantFile & '" is missing.')
EndSwitch

Notes: Please comment your feedback, advice, & suggestions below. While this is only a proof of concept, I will expand its feature set for everyone to use. 

Right now, it is fully functional but not tested in production.

 

 

Changelog:

RollbarSDK.au3

RollbarTest.au3

v0.2

Spoiler

https://www.autoitscript.com/forum/topic/198704-rollbar/?do=findComment&comment=1427145

This update contains massive script breaking changes.

Added:

  • Multilingual support. See #CONSTANTS# section.
    Note: I won't be able to provide translations.

Changed/Fixed:

  • All functions and variables have been renamed to align with UDF best practices.

 

 

v0.1.1

Spoiler

https://www.autoitscript.com/forum/topic/198704-rollbar/?do=findComment&comment=1426743

This update contains script breaking changes. See RollbarInit (2 Parameters ==> 1)

Added:

  • Main Function: RollbarInit_Ask (Asks for user permission to send automatic bug reports, saves preference in ScriptName_Debug.ini) (For devs who respect user privacy)
  • Helper Function: Rollbar_CreateItem (same as RollbarCreateItem)
  • Helper Function: Rollbar_Send (same as RollbarCreateItem)
  • Helper Function: Rollbar_SendDebug (Rollbar_Send as Debug)
  • Helper Function: Rollbar_SendInfo (Rollbar_Send as Info)
  • Helper Function: Rollbar_SendWarning (Rollbar_Send as Warning)
  • Helper Function: Rollbar_SendError (Rollbar_Send as Error)
  • Helper Function: Rollbar_SendCritical (Rollbar_Send as Critical)
  • ConsoleWrite Debugging Override: $Rollbar_Debug = True / False

Changed/Fixed:

  • Split RollbarCreateItem into 2 functions: RollbarCreateItem & RollbarSendItem
  • ConsoleWrite Debugging is now Opt-In on compiled builds only. 
  • Decreased number of parameters for RollbarInit.
  • Cleaned up some comments
  • RollbarCreateItem & RollbarSendItem now properly sets a reasonably expectable return value (True when successful, False when failed)

Removed:

  • Removed optional write token.

 

Edited by BetaLeaf
Changed wording from UDF to Proof of Concept.

 

False Positive Reporter - Mass email all anti-virus vendors with an attachment of your program for fast and easy whitelisting.

RollbarSDK UDF - Provides real-time error alerting & debugging tools for developers. 

 

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks  for sharing.

Will look closer.

Edited by mLipok

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API Forum Rules *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

11

Signature last update: 2018-10-31

Share this post


Link to post
Share on other sites
4 minutes ago, mLipok said:

Thanks  for sharing.

Will look closer.

Thanks for checking it out. Let me know what you think and what I can do to improve it.


 

False Positive Reporter - Mass email all anti-virus vendors with an attachment of your program for fast and easy whitelisting.

RollbarSDK UDF - Provides real-time error alerting & debugging tools for developers. 

 

Share this post


Link to post
Share on other sites

I like where this is going and I have some suggestions, which you don't have to agree with

  • Rename RollbarCreateItem to Rollbar_Send
    • I understand what you are trying to convey, by having the API item as part of the name, but "CreateItem" in this case is also sending data to Rollbar
  • Create help functions e.g.
    • Rollbar_SendDebug
    • Rollbar_SendInfo
    • ....
  • Writing to the console should be opt-in and not on by default, either by using a flag or by asking for a logging function
  • RollbarCreateItem is quite big, and can be broken down into smaller functions
  • Validation of the API token would be good

Keep it up!


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

Thanks for the feedback. Rest assured, I will use your feedback to improve the SDK. I'm working on it now.


 

False Positive Reporter - Mass email all anti-virus vendors with an attachment of your program for fast and easy whitelisting.

RollbarSDK UDF - Provides real-time error alerting & debugging tools for developers. 

 

Share this post


Link to post
Share on other sites
5 hours ago, guinness said:

Validation of the API token would be good

How do you recommend I handle this when it fails? 

I feel that before a production release that the developer should make sure the API keys are working. You can already tell from ConsoleWrite messages if the key is working or not. I don't think it would be a good idea to let user's know API key is broken or even ask them to fill it in. This should all be handled by the developer. I don't even think it is a good idea to warn the user that API keys are invalid. Advice?


 

False Positive Reporter - Mass email all anti-virus vendors with an attachment of your program for fast and easy whitelisting.

RollbarSDK UDF - Provides real-time error alerting & debugging tools for developers. 

 

Share this post


Link to post
Share on other sites
Posted (edited)

Updated to v0.1.1

This update contains script breaking changes. See RollbarInit (2 Parameters ==> 1)

Added:

  • Main Function: RollbarInit_Ask (Asks for user permission to send automatic bug reports, saves preference in ScriptName_Debug.ini) (For devs who respect user privacy)
  • Helper Function: Rollbar_CreateItem (same as RollbarCreateItem)
  • Helper Function: Rollbar_Send (same as RollbarCreateItem)
  • Helper Function: Rollbar_SendDebug (Rollbar_Send as Debug)
  • Helper Function: Rollbar_SendInfo (Rollbar_Send as Info)
  • Helper Function: Rollbar_SendWarning (Rollbar_Send as Warning)
  • Helper Function: Rollbar_SendError (Rollbar_Send as Error)
  • Helper Function: Rollbar_SendCritical (Rollbar_Send as Critical)
  • ConsoleWrite Debugging Override: $Rollbar_Debug = True / False

Changed/Fixed:

  • Split RollbarCreateItem into 2 functions: RollbarCreateItem & RollbarSendItem
  • ConsoleWrite Debugging is now Opt-In on compiled builds only. 
  • Decreased number of parameters for RollbarInit.
  • Cleaned up some comments
  • RollbarCreateItem & RollbarSendItem now properly sets a reasonably expectable return value (True when successful, False when failed)

Removed:

  • Removed optional write token.
Edited by BetaLeaf

 

False Positive Reporter - Mass email all anti-virus vendors with an attachment of your program for fast and easy whitelisting.

RollbarSDK UDF - Provides real-time error alerting & debugging tools for developers. 

 

Share this post


Link to post
Share on other sites

Some suggestions:

- https://www.autoitscript.com/wiki/Best_coding_practices
- https://www.autoitscript.com/wiki/UDF-spec
- Remove AutoIt3Wrapper directives from UDF (even if just AU3Check; remove on release or add to RollbarTest.au3 instead).
- Replace .ini operations by a 2D array (set from function like _Rollbar_Set($iAttr, $nValue) ).
- Remove MsgBox() -calls and saving as .ini or move to separate function (so main script controls MsgBox(), .ini file path and choice to load or not; configuration, permission and GUI-notification being calling/including script's responsibility, UDF itself to be concerned with maintaining valid internal state only).
- Accept output from dedicated error logger function/UDF instead (or split into separate UDF's). Error loggers ideally enable registering custom functions on Exit, for COM Object errors, for custom date/time format and item output (console, file, Beep(), etc.), and auto-elevate level if @error (level error), if @extended (level debug), or if @exitCode (level critical/fatal), inclusion of @ScriptLineNumber, transparently passing @error/@extended, etc.; which (along with other error-logger's functionality) although necessary, seems out of scope for a Rollbar transmission UDF specifically.
- Rollbar_Send...() et al. seem redundant; single function could accept level parameter as int (using Enum instead of quoted str has SciTE suggest auto-completion too). Generally error level depends on outcome logged; naming functions after parameters introduces hard coded specificity as (unless used with Call() ) it's valid within pre-defined (foreseen) context only (specific If/Else branch for example).
- Hard coded text messages don't sit well with German, French, Russian, etc. AutoIt communities (of consideration if widespread adoption is a goal).

Share this post


Link to post
Share on other sites
Posted (edited)
On 5/5/2019 at 11:18 AM, user4157124 said:

Replace .ini operations by a 2D array (set from function like _Rollbar_Set($iAttr, $nValue) ).

Do you have a specific use case in mind? The only reason to set Ini is to save user preference rather or not they want to allow or disallow automatic bug reporting. I don't see a good reason to create a function just to set values once.

On 5/5/2019 at 11:18 AM, user4157124 said:

Remove MsgBox() -calls and saving as .ini or move to separate function (so main script controls MsgBox(), .ini file path and choice to load or not; configuration, permission and GUI-notification being calling/including script's responsibility, UDF itself to be concerned with maintaining valid internal state only).

Can you please be a bit clearer so I can better understand what you are requesting?

On 5/5/2019 at 11:18 AM, user4157124 said:

Accept output from dedicated error logger function/UDF instead (or split into separate UDF's). Error loggers ideally enable registering custom functions on Exit, for COM Object errors, for custom date/time format and item output (console, file, Beep(), etc.), and auto-elevate level if @error (level error), if @extended (level debug), or if @exitCode (level critical/fatal), inclusion of @ScriptLineNumber, transparently passing @error/@extended, etc.; which (along with other error-logger's functionality) although necessary, seems out of scope for a Rollbar transmission UDF specifically.

This is too jumbled for me to understand. Can you please be a bit clearer so I can better understand what you are requesting?

On 5/5/2019 at 11:18 AM, user4157124 said:

Rollbar_Send...() et al. seem redundant; single function could accept level parameter as int (using Enum instead of quoted str has SciTE suggest auto-completion too). Generally error level depends on outcome logged; naming functions after parameters introduces hard coded specificity as (unless used with Call() ) it's valid within pre-defined (foreseen) context only (specific If/Else branch for example).

[Rejected]  Rollbar_Send is redundant, however, as you said, "Generally error level depends on outcome logged". This allows devs to be more flexible.
[Rejected]  ErrorLevel must be a string, because Rollbar REST API expects a string. I cannot send as int.

On 5/5/2019 at 11:18 AM, user4157124 said:

https://www.autoitscript.com/wiki/Best_coding_practices
https://www.autoitscript.com/wiki/UDF-spec
Remove AutoIt3Wrapper directives from UDF (even if just AU3Check; remove on release or add to RollbarTest.au3 instead).
Hard coded text messages don't sit well with German, French, Russian, etc. AutoIt communities (of consideration if widespread adoption is a goal).

Done and coming soon in v0.2
 
@user4157124 If I misunderstood anything, please clarify by being clear and concise. 
Edited by BetaLeaf
Clarification

 

False Positive Reporter - Mass email all anti-virus vendors with an attachment of your program for fast and easy whitelisting.

RollbarSDK UDF - Provides real-time error alerting & debugging tools for developers. 

 

Share this post


Link to post
Share on other sites

I just updated my previous comment. I posted too early by accident (hotkey). If you are currently replying, please review the edits before submitting your comment.


 

False Positive Reporter - Mass email all anti-virus vendors with an attachment of your program for fast and easy whitelisting.

RollbarSDK UDF - Provides real-time error alerting & debugging tools for developers. 

 

Share this post


Link to post
Share on other sites

Updated to v0.2
Now aligned with UDF best practices!

This update contains massive script breaking changes.

Added:

  • Multilingual support. See #CONSTANTS# section.
    Note: I won't be able to provide translations.

Changed/Fixed:

  • All functions and variables have been renamed to align with UDF best practices.

 

RollbarSDK.au3 RollbarTest.au3


 

False Positive Reporter - Mass email all anti-virus vendors with an attachment of your program for fast and easy whitelisting.

RollbarSDK UDF - Provides real-time error alerting & debugging tools for developers. 

 

Share this post


Link to post
Share on other sites
Posted (edited)

"Do you have a specific use case in mind?"

UDF settings in general (the individual global vars). Including script should decide how to configure UDF (and where to get settings from). File path is hard-coded currently (location requires administrative rights to modify if used in compiled script installed to \Program Files\). Array enables setting options like:

Func Rollbar_Set($iAttr, $nValue)
$__g_aRollbar_Opt[$iAttr] = $nValue
...
EndFunc


"Can you please be a bit clearer so I can better understand what you are requesting?"

UDF accepts user choices and outputs information, but including script should control presentation (MsgBox(), GUI, etc.). Including this UDF to scripts compiled as console for example, forces display of GUI elements (mixes logic and presentation; scripts can't control its behavior).

"This is too jumbled for me to understand. Can you please be a bit clearer so ..."

Too concise probably. Error loggers require quite some functionality to be considered useful (but most of that seems out of scope for this UDF). Some users posted dedicated error logging UDF's; yours could take their output as input.

"This allows devs to be more flexible."

Design choice being (opinion based, current way is fine too):

Rollbar_SendWarning('Msg')
Rollbar_SendError('Msg')

or:

Rollbar_Send($ROLLBAR_LVL_WARNING, 'Msg')
Rollbar_Send($ROLLBAR_LVL_ERROR, 'Msg')


"... Rollbar REST API expects a string."

That's what UDF's are for (to make sure what gets input is output as required). Example (no out of bounds -check):

Func Rollbar_Send($iLevel, $sMsg = '')
Local $aLevel = ['trace', 'debug', 'info', 'warning', 'error', 'fatal']
Local $sLevel = $aLevel[$iLevel]
...
EndFunc


2D arrays are ideal for localization:

Enum $ROLLBAR_LANG_EN, $ROLLBAR_LANG_DE, ..., $ROLLBAR_LANG__ENUM
Enum $ROLLBAR_TEXT_TEST, ..., $ROLLBAR_TEXT__ENUM
Global $__g_aRollbar_Txt[$ROLLBAR_TEXT__ENUM][$ROLLBAR_LANG__ENUM]
$__g_aRollbar_Txt[$ROLLBAR_TEXT_TEST][$ROLLBAR_LANG_EN] = 'Example text.'
$__g_aRollbar_Txt[$ROLLBAR_TEXT_TEST][$ROLLBAR_LANG_DE] = 'Beispieltext.'

$g_iLang = $ROLLBAR_LANG_EN
MsgBox($MB_OK, @ScriptName, $__g_aRollbar_Txt[$ROLLBAR_TEXT_TEST][$g_iLang])

Edited by user4157124

Share this post


Link to post
Share on other sites

@user4157124 Thank you for clarifying. I'll work on it a bit later today or tomorrow. I spend all day working on v0.2 yesterday and I'm only one guy haha. I did have a few more questions.

You mentioned that my design decisions are opinion based. You have an opinion as well. I'd like to hear it. Get your perspective on things. Mind discussing this with me?

You also mentioned that I have a hard coded path. Which path are you talking about? I'm pretty sure the only file being written to is the SCRIPTNAMENOEXT_Debugging.ini and the only reason I write this file is to save user preference when _Rollbar_Init_Ask is used. Using _Rollbar_Init won't ask the user, which means no saved ini file, and force it on. I can't see your use case having any relevance here. Your set variables would be lost when the app is closed. Can you provide a use case for this?

I'm going to look up these error reporting UDFs you mentioned. Did you have any specific ones in mind?

Is there a best practices page for regarding localization in autoit? You are clearly more knowledgeable regarding this topic, so I'd like to take this opportunity to learn something new. 


 

False Positive Reporter - Mass email all anti-virus vendors with an attachment of your program for fast and easy whitelisting.

RollbarSDK UDF - Provides real-time error alerting & debugging tools for developers. 

 

Share this post


Link to post
Share on other sites

I meant my design suggestion is opinion based (function level name vs. level parameter). Seeing different settings (onoff/debug -state, file path, API key) I suggested formalization (set -function could do what _Init, _Init_Ask, $__G_Rollbar_bDebug and hard coded .ini file path do). Availability throughout runtime has no particular advantage to that specific option no. MsgBox() -choice and IniRead() is nice to have, but generally including script's responsibility.

The .ini file is referenced relative to @ScriptDir, so when C:\Program Files\MBP\MyBigProgram.exe (compiled AutoIt script having #include "RollbarSDK.au3") wants to let RollbarSDK do its IniWrite(), then MyBigProgram.exe needs admin rights (because @ScriptDir is a folder in C:\Program Files). That is the hard coded path (despite @ScriptDir being relative). It is distinct from @WorkingDir additionally (line 48).

I am not aware of documented localization best-practices for AutoIt (but wouldn't differ from other languages). Simply returning @error (not generating messages) enables including script to relate as required.
May be as simple as $sError = $aError[@error][$iLang] (if @error from _Rollbar_SendItem() is of Enum instead of HTTP code). Or as formal as separate text files (so changes require restart/reload rather than recompile). Also, StringFormat('HTTP Status %i - %s', $iCode, $sMsg) may save a few constants.

Error loggers :
https://www.autoitscript.com/forum/topic/195862-loga-a-logging-library/
https://www.autoitscript.com/forum/topic/195882-errorlogau3-udf-a-logging-library/

I use another (not sure how it compares, may release if anyone cares).

Share this post


Link to post
Share on other sites
3 hours ago, user4157124 said:

I use another (not sure how it compares, may release if anyone cares).

Would be nice to take a look...


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API Forum Rules *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

11

Signature last update: 2018-10-31

Share this post


Link to post
Share on other sites

@user4157124
Both of those error loggers don't  seem to really offer anything different than what I already offer with Rollbar UDF. You can easily create a variable to hold the message and send it to both Rollbar UDF and your error logger of choice. 

5 hours ago, user4157124 said:

The .ini file is referenced relative to @ScriptDir, so when C:\Program Files\MBP\MyBigProgram.exe (compiled AutoIt script having #include "RollbarSDK.au3") wants to let RollbarSDK do its IniWrite(), then MyBigProgram.exe needs admin rights (because @ScriptDir is a folder in C:\Program Files). That is the hard coded path (despite @ScriptDir being relative). It is distinct from @WorkingDir additionally (line 48).

When you #Include "RollbarSDK.au3" and use _Rollbar_Init_Ask, then it will write to @ScriptDir. This ensures that the user preference for automatic reporting (either enabled or disabled) can always be found. @ScriptDir ensures that the ini file writes to the same directory as the program that included it. This has a couple of added benefits/protections: 

1) If you install your program to a protect folder that needs admin to read/write, then you should also probably protect the user preference. If you want to disable this, you can simply change the permissions (Windows ACL) of the ini file to allow Users or Everyone to read/write the file. This gives the end user a degree of control from limited users on their systems. (A guest account, maybe malicious, might find it a good idea to disable logging so they don't get reported, and a sysadmin might want to prevent this from happening) 
2) For multiple projects, this ensures that each program's preference is easily identifiable.
3) A badly written UDF that changes the working directory would cause unintended side effects when trying to save the user preference
(saving in the wrong directory, but shouldn't effect reading the file back in this case, just harder to find because it isn't where you expect it to be).
4) Prevents the end user from setting a different working directory (from a desktop shortcut, for example) and causing unintended side effects when trying to save the user preference.

5 hours ago, user4157124 said:

Also, StringFormat('HTTP Status %i - %s', $iCode, $sMsg) may save a few constants.

I didn't know about this. I'll take a look into this and implement it.

P.S. This was all meant to be a Proof-Of-Concept and not so much a UDF. It was my mistake to label it a UDF. I'm not super excited to continue working on this project and would rather work on the next project on my list. I will still continue to work on it, as long as there is interest and people make suggestions or requests. If I am too slow to get your request out, then the source code (RollbarSDK.au3) is there and anyone can continue my work under the MIT license. All I really care about is being credited for my work. Just include my name somewhere and we're good. My MIT License


 

False Positive Reporter - Mass email all anti-virus vendors with an attachment of your program for fast and easy whitelisting.

RollbarSDK UDF - Provides real-time error alerting & debugging tools for developers. 

 

Share this post


Link to post
Share on other sites
Posted (edited)

No need to rename (it's a UDF, good one too). And serves a purpose.

@WorkingDir was not a suggestion; line 48 describes @ScriptDir as "Working Directory". The predefined path isn't a problem (non asking function available too) but illustrates limitations introduced by a solution implemented on different level/scope than it affects.

@mLipok

Could do something like :

#AutoIt3Wrapper_AU3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#include "auerlo.au3"
#include "RollbarSDK.au3"

Main()

Func Main()
    Local $aArray

    _AUERLO_Set($AUERLO_OPT_LOGSTD,     True)
    _AUERLO_Set($AUERLO_OPT_LVLSTD,     $AUERLO_LVL_ALL)
    _AUERLO_Set($AUERLO_OPT_LOGCUSTOM,  True)
    _AUERLO_Set($AUERLO_OPT_LVLCUSTOM,  $AUERLO_LVL_WARNING)
    _AUERLO_Set($AUERLO_OPT_FUNCCUSTOM, __AUERLO_OutputRollbar)
    _AUERLO_Set($AUERLO_OPT_FUNCEXIT,   Default)
    _AUERLO_Set($AUERLO_OPT_FUNCCOM,    Default)
    _AUERLO_Set($AUERLO_OPT_TIMEUTC,    True); Consistency on collective deployment.

    _Rollbar_Init('RollbarAPIkeyhere')
    _AUERLO_Log()

    For $i1 = $AUERLO_LVL_TRACE To $AUERLO_LVL_FATAL

        _AUERLO_Log('Message #' & $i1 + 1, $i1)

    Next

    _AUERLO_Read($aArray)
    _AUERLO_View($aArray)

;   Exit
EndFunc

Volatile Func __AUERLO_OutputRollbar($aData)
    Local       $aLvl[$AUERLO_LVL__ENUM]
                $aLvl[$AUERLO_LVL_TRACE]   = 'Debug'
                $aLvl[$AUERLO_LVL_DEBUG]   = 'Debug'
                $aLvl[$AUERLO_LVL_INFO]    = 'Info'
                $aLvl[$AUERLO_LVL_WARNING] = 'Warning'
                $aLvl[$AUERLO_LVL_ERROR]   = 'Error'
                $aLvl[$AUERLO_LVL_FATAL]   = 'Critical'
    Local Const $sLvl = $aLvl[ $aData[$AUERLO_ATR_LEVEL] ], _
                $sMsg = $aData[$AUERLO_ATR_DATETIME] & ($__g_aAUERLO_OptCur[$AUERLO_OPT_TIMEUTC] ? 'UTC' : 'loc') _
                      & $aData[$AUERLO_ATR_MESSAGE] ? ' - ' : '' _
                      & $aData[$AUERLO_ATR_MESSAGE], _
                $sCat = __AUERLO_GetTxtLevel($aData[$AUERLO_ATR_LEVEL]); Or other category -determining function.
    Local Const $iRet = _Rollbar_CreateItem($sLvl, $sMsg, $sCat)

;   _AUERLO_Log('_AUERLO_AuerloToRollbar()'); Infinite regress on _Rollbar_CreateItem() @error?

    Return SetError(@error, @extended, $iRet)
EndFunc

 

Edited by user4157124

Share this post


Link to post
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

  • Similar Content

    • By kurtykurtyboy
      GuiFlatButton is a UDF to easily create regular buttons with different colors for background, foreground, border, hover, focus, etc..
      This started as an effort to change the background color of a button and eventually grew into a full UDF.
      If you've looked around forums for changing button background colors, you have probably noticed that each proposed workaround has its own set of issues/side-effects. The answers usually circle back to 'use ownerdrawn buttons' and 'not worth it'. Well, now it is possible for anyone to easily create ownerdrawn buttons - totally worth it!
      Some issues with other workarounds such as drawing with GDI+ or using a colored label as a 'button':
      Not 'real' buttons so you lose built-in functionality that windows gives to buttons Messy / inefficient code in the main while loop to check for mouse position Slow to respond to click, paint, etc... Having to deal with GUIRegisterMsg messages Not straight-forward to implement GuiFlatButton is not a workaround; it is a technique to respond to Windows' built-in owner-drawn button events.
      With minimal effort, we can now create true simple colored buttons.
      The idea is to create an owner-drawn button using GUICtrlCreateButton then subclass the GUI and controls to handle the button-specific events to paint it however we want.
      This UDF magically does all of this for us! No need to worry about event handling or main while loop logic.
       
      How to use
      It couldn't be any easier! Simply create a new button using the familiar syntax. This creates an ownerdrawn button with default colors.
      $mybutton1 = GuiFlatButton_Create("Button 1", 78, 20, 120, 40) If you want to change the background and text colors:
      GuiFlatButton_SetBkColor(-1, 0x5555FF) GuiFlatButton_SetColor(-1, 0xFFFFFF) Advanced Usage
      Set background/text/border all at once
      GuiFlatButton_SetColors(-1, 0x0000FF, 0xFFFFFF, 0x9999FF) Set ALL colors for ALL button states! (normal, focus, hover, selected)
      Local $aColorsEx = [0x0000FF, 0xFFFFFF, -2, 0x4444FF, 0xFFFFFF, 0xAAAAFF, 0x6666FF, 0xFFFFFF, 0xCCCCFF, 0x0000EE, 0xFFFFFF, 0x7777EE] GuiFlatButton_SetColorsEx(-1, $aColorsEx) Set default colors to apply to any future buttons
      ;set colors GuiFlatButton_SetDefaultColors(0x0000FF, 0xFFFFFF, 0x9999FF) ;create buttons $mybutton1 = GuiFlatButton_Create("Button 1", 12, 20, 120, 40) $mybutton2 = GuiFlatButton_Create("Button 2", 143, 20, 120, 40) Set ALL color defaults
      ;set colors Local $aColorsEx = [0x0000FF, 0xFFFFFF, -2, 0x4444FF, 0xFFFFFF, 0xAAAAFF, 0x6666FF, 0xFFFFFF, 0xCCCCFF, 0x0000EE, 0xFFFFFF, 0x7777EE] GuiFlatButton_SetDefaultColorsEx($aColorsEx) ;create buttons $mybutton1 = GuiFlatButton_Create("Button 1", 12, 20, 120, 40) $mybutton2 = GuiFlatButton_Create("Button 2", 143, 20, 120, 40)  
      Available Functions
       
      Simple Example

      #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include "GuiFlatButton.au3" Example() ;GUI with one button Func Example() Local $hGUI, $mybutton1 $hGUI = GUICreate("GuiFlatButton Ex0", 275, 120) GUISetBkColor(0x333333) $idLabel = GUICtrlCreateLabel("Click the button", 10, 100, 150, 30) GUICtrlSetColor(-1, 0xFFFFFF) ;create new button then set the background and foreground colors $mybutton1 = GuiFlatButton_Create("Button 1", 78, 20, 120, 40) GuiFlatButton_SetBkColor(-1, 0x5555FF) GuiFlatButton_SetColor(-1, 0xFFFFFF) GUISetState(@SW_SHOW, $hGUI) Local $i = 0 Local $iMsg While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE ExitLoop Case $mybutton1 $i += 1 GUICtrlSetData($idLabel, $i) ConsoleWrite($i & @CRLF) EndSwitch Sleep(10) WEnd GUIDelete() EndFunc ;==>Example
      Menu/Toolbar Example

      #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include "GuiFlatButton.au3" Example() ;Example GUI with toolbar Func Example() Local $hGUI, $idLabel, $aButtons, $iTbSize $hGUI = GUICreate("GuiFlatButton Ex2", 300, 200) GUISetBkColor(0x444444) $idLabel = GUICtrlCreateLabel("Click a button", 10, 180, 150, 30) GUICtrlSetColor(-1, 0xFFFFFF) $aButtons = createToolbar() $iTbSize = UBound($aButtons) GUISetState(@SW_SHOW, $hGUI) Local $i = 0 Local $iMsg While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE ExitLoop Case $aButtons[0] To $aButtons[$iTbSize - 1] ConsoleWrite("1") GUICtrlSetData($idLabel, GuiFlatButton_Read($iMsg)) EndSwitch Sleep(10) WEnd GUIDelete() EndFunc ;==>Example Func createToolbar() Local $aButtons[6] Local $bkColor = 0x777777 Local $textColor = 0xFFFFFF Local $borderColor = 0x999999 Local $aBtnClrs[12] = [0x777777, 0xFFFFFF, $GUI_BKCOLOR_TRANSPARENT, 0x888888, 0xFFFFFF, $GUI_BKCOLOR_TRANSPARENT, 0x999999, 0xFFFFFF, $GUI_BKCOLOR_TRANSPARENT, 0x666666, 0xFFFFFF, $GUI_BKCOLOR_TRANSPARENT] For $i = 0 To UBound($aButtons) - 1 $aButtons[$i] = GuiFlatButton_Create("B" & $i, $i * 50, 0, 50, 17) GuiFlatButton_SetColorsEx($aButtons[$i], $aBtnClrs) Next Return $aButtons EndFunc ;==>createToolbar  
      Icon Example
      You can even easily add icons to your buttons -- just create a new button and send it an icon!

      #include <GDIPlus.au3> #include "GuiFlatButton.au3" Example() ;buttons with Icon images Func Example() ;get images for demonstration _GDIPlus_Startup() ;initialize GDI+ Local $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll', 258, 24, 24) ;extract the 'Save' icon Local $hBitmap = _GDIPlus_BitmapCreateFromHICON($hIcon) ;Create Bitmap from Icon (for demonstration) Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) ;Create HBitmap from Bitmap _GDIPlus_BitmapDispose($hBitmap) ;dispose the bitmap _GDIPlus_Shutdown() ;done with GDI+ Local $hGUI = GUICreate("GuiFlatButton Ex5", 255, 400) GUISetBkColor(0xEEEEEE) ;set default colors of future buttons Local $aColorsEx = _ [0xE2E5E8, 0X000000, 0x888888, _ ; normal : Background, Text, Border 0xE2E5E8, 0X000000, 0x333333, _ ; focus : Background, Text, Border 0xE8E8E8, 0X000000, 0x666666, _ ; hover : Background, Text, Border 0xDDDDDD, 0X000000, 0xAAAAAA] ; selected : Background, Text, Border GuiFlatButton_SetDefaultColorsEx($aColorsEx) ;normal button with icon $label1 = GUICtrlCreateLabel( "$BS_TOOLBUTTON -->", 5, 10) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) Local $mybutton1 = GuiFlatButton_Create("Save", 130, 5, 50, 48, $BS_TOOLBUTTON) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybutton1), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align top Local $mybuttonT = GuiFlatButton_Create("Top", 5, 65, 120, 55, $BS_TOP) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonT), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align top-left Local $mybuttonTL = GuiFlatButton_Create("Top-Left", 5, 125, 120, 55, BITOR($BS_TOP, $BS_LEFT)) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonTL), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align top-right Local $mybuttonTR = GuiFlatButton_Create("Top-Right", 5, 185, 120, 55, BITOR($BS_TOP, $BS_RIGHT)) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonTR), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align left Local $mybuttonL = GuiFlatButton_Create("Left", 5, 245, 120, 55, $BS_LEFT) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonL), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align bottom Local $mybuttonB = GuiFlatButton_Create("Bottom", 130, 65, 120, 55, $BS_BOTTOM) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonB), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align bottom-left Local $mybuttonBL = GuiFlatButton_Create("Bottom-Left", 130, 125, 120, 55, BITOR($BS_BOTTOM, $BS_LEFT)) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonBL), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align bottom-right Local $mybuttonBR = GuiFlatButton_Create("Bottom-Right", 130, 185, 120, 55, BITOR($BS_BOTTOM, $BS_RIGHT)) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonBR), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align right Local $mybuttonR = GuiFlatButton_Create("Right", 130, 245, 120, 55, $BS_RIGHT) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonR), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) GuiFlatButton_SetState($mybuttonR, $GUI_DISABLE ) ;disabled Local $mybuttonDisable = GuiFlatButton_Create("Disabled", 130, 310, 120, 55, $BS_TOOLBUTTON) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonDisable), $BM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap)) GuiFlatButton_SetState($mybuttonDisable, $GUI_DISABLE ) ;clean up! _WinAPI_DestroyIcon( $hIcon ) _WinAPI_DeleteObject( $hHBitmap ) GUISetState(@SW_SHOW, $hGUI) Local $iMsg While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE ExitLoop EndSwitch Sleep(10) WEnd GUIDelete() EndFunc ;==>Example  
      I'm sure there are some use-cases I've forgotten, so feedback is welcome!
       
      Download the UDF and several more examples: GuiFlatButton_20190414.zip
      Update 2019-04-14
      Fixed bug, not showing pressed down state when clicking rapidly
      Added Icon/Bitmap support!
      Added function GuiFlatButton_SetPos to change the position and/or size of a button
      Update 2019-02-09
      Added 2 new functions to set the button colors globally for all future buttons.
      GuiFlatButton_SetDefaultColors 
      GuiFlatButton_SetDefaultColorsEx

      Credits to:
      Melba23 (UDF template)
      LarsJ (general subclassing code)
      4ggr35510n (TrackMouseEvent example)
      binhnx (disable dragging with $WS_EX_CONTROLPARENT)
      GUIRegisterMsg in AutoIt Help (owner-draw button example)
      funkey (_WinAPI_DrawState example)
    • By Dwalfware
      Hi Folks
      Can not get my head around this one.
      This function gets the DNS object s
      If you have two DNS entries fine. but if you have only one! Trouble
      $objItem.DNSServerSearchOrder[0] = Primary DNS
      $objItem.DNSServerSearchOrder[1] = Secondry DNS not always there. I need a way to return 0 if not there or the IP if its there.
      Or is there a way to tell how many objects there are in the "[?]"
      I'm terrible at WMI errors, thanks for help in advance.
      Func _GETcurrentNICinfo2() $oErrors = ObjEvent("AutoIt.Error", "Error_Handle") Local $DnsSecondry Local $objWMIService = ObjGet( "winmgmts:\\" & @ComputerName & "\root\CIMV2" ) Local $query = $objWMIService.ExecQuery("SELECT DNSServerSearchOrder FROM Win32_NetworkAdapterConfiguration WHERE Index = " & _GetSelectedNIC(), "WQL", 0x30 ) If @error Then Return 0 If NOT IsObj($query) Then Return 0 Else For $objItem In $query Return $objItem.DNSServerSearchOrder[1] next Endif EndFunc  
    • By qsek
      Im not sure if this is intended but normally Autoit variables are always passed as copies (except objects i think).
      But below i observed an unconsistency when copying maps with nested maps inside.
      Issue:
      If you create a nested map1 and copy it to a new map2, changing a nested value in map2 will also change the nested value in map1
      Dim $player[] Dim $sub[] $player.test1 = 1 $player.test2 = $sub $player.test2.child1 = "org" $player.test2.childext = $sub $player.test2.childext.child1 = "org2" $playerold = $player ; make a copy of the whole map ConsoleWrite("player.test2.child1 : "& $player.test2.child1 & @CRLF); original nested value in $player $playerold.test2.child1 = "changed" ; edit a nested value in $playerold ConsoleWrite("player.test2.child1 : "& $player.test2.child1 & @CRLF) ; original nested value in $player changed ConsoleWrite("---------------------" & @CRLF) ConsoleWrite("player.test2.childext.child1 : "& $player.test2.childext.child1 & @CRLF); original level2 nested value in $player $playerold.test2.childext.child1 = "changed2" ; edit a level2 nested value in $playerold ConsoleWrite("player.test2.child1 : "& $player.test2.child1 & @CRLF); original level1 nested value in $player stayed the same ConsoleWrite("player.test2.childext.child1 : "& $player.test2.childext.child1 & @CRLF); original level2 nested value in $player changed  
    • By MFrancisca
      Hello! 
      I've been checking the logging UDFs in the wiki, mostly Log4a and Loga and I wanted to ask which one would you recommend for a script that will be executed remotely through PSExec. My main question is where the logs are located in that situation and if I can change that location to a custom one., because I need to retrieve them at the end of execution.
      So in a rough description the process is
      Open PSExec
      Send compiled AutoIT script to remote machine
      Execute script
      Copy logs from the remote to the local machine.
       
      Any opinions? 
    • By vati1011
      Hey, guys.
      Currently, I'm using Opencv UDF and i'm  encountering issues with DLLOPEN(). it is failing and returning -1
      But, I cannot figure out why it is failing.
      I need help from people.
      I'm running windows 10 32bit.
      This's my code.
      #RequireAdmin $fileopen = DllOpen("opencv_core2413.dll") MsgBox(0,"Result",$fileopen) Example.au3opencv_core2413.dll
×
×
  • Create New...