Khryus Posted March 3, 2012 Share Posted March 3, 2012 Func loadAccountsData() if FileExists("accs.txt") and FileExists("pwds.txt") Then $MaxAccs=5 Local $usrs[$MaxAccs] Local $pwds[$MaxAccs] Local $acc=FileOpen("accs.txt") Local $pwd=FileOpen("pwds.txt") For $i=1 To $MaxAccs Step 1 $usrs[$i] = FileReadLine($acc, $i) $pwds[$i] = FileReadLine($pwd, $i) Next For $i=1 To $MaxAccs Step 1 GUICtrlSetData($UsernamesList, $usrs[$i]&"|") GUICtrlSetData($PasswordsList, $pwds[$i]&"|") Next Else MsgBox(16, "error", "Either accounts or password files weren't found.") EndIfEndFuncI'm getting this error when I run the script via the SCiTE editor:C:\Workspace\newgui.au3 (138) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:$usrs[$i] = FileReadLine($acc, $i)^ ERROR$UsernamesList and $PassowrdsList are lists created earlier "The story of a blade is linked in Blood." ―Yasuo Link to comment Share on other sites More sharing options...
water Posted March 3, 2012 Share Posted March 3, 2012 (edited) The array $usrs has 5 elements numbered from 0 to 4. You try to access elements 1 to 5 in your loop. Your script crashes when you try to access the non existant element 5.Change the loop statement to "For $i=0 To $MaxAccs-1"There is a very good tutorial explaining arrays in the wiki. Edited March 3, 2012 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Khryus Posted March 3, 2012 Author Share Posted March 3, 2012 Thanks, it works now "The story of a blade is linked in Blood." ―Yasuo Link to comment Share on other sites More sharing options...
water Posted March 3, 2012 Share Posted March 3, 2012 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Khryus Posted March 3, 2012 Author Share Posted March 3, 2012 (edited) I have another problem: Local $usrs[$MaxAccs] Local $pwds[$MaxAccs] I declared MaxAccs earlier, at the very start of the script. I want to use the one I declared at the top, not the one I'm forced to put inside the function. Forced because if I remove that, it tells me that the variable $MaxAccs doesn't exist. I tried adding Global before $MaxAccs, but it still gives me the error. How can I fix? This is the error I'm talking about: C:Workspacenewgui.au3 (130) : ==> Variable used without being declared.: Edited March 3, 2012 by megablox "The story of a blade is linked in Blood." ―Yasuo Link to comment Share on other sites More sharing options...
water Posted March 3, 2012 Share Posted March 3, 2012 What error do you get? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Khryus Posted March 3, 2012 Author Share Posted March 3, 2012 C:Workspacenewgui.au3 (130) : ==> Variable used without being declared.: I typed that in an edit "The story of a blade is linked in Blood." ―Yasuo Link to comment Share on other sites More sharing options...
water Posted March 3, 2012 Share Posted March 3, 2012 (edited) Then there is either a typo in the variable declaration or you declare the variable AFTER calling the function. Could you post the code where you define the variable and where you call the function? Edited March 3, 2012 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Khryus Posted March 3, 2012 Author Share Posted March 3, 2012 (edited) line 89 (after koda's gui generation bit) ; Global $MaxAccs=5 more code down here line 128; Func loadAccountsData() if FileExists("C:\Program Files (x86)\Blackout RO Bot\dir\accs.txt") and FileExists("C:\Program Files (x86)\Blackout RO Bot\dir\pwds.txt") Then Local $usrs[$MaxAccs] Local $pwds[$MaxAccs] $acc=FileOpen("C:\Program Files (x86)\Blackout RO Bot\dir\accs.txt") $pwd=FileOpen("C:\Program Files (x86)\Blackout RO Bot\dir\pwds.txt") For $i=0 To $MaxAccs-1 Step 1 $usrs[$i] = FileReadLine($acc, $i) $pwds[$i] = FileReadLine($pwd, $i) Next For $i=0 To $MaxAccs-1 Step 1 GUICtrlSetData($UsernamesList, $usrs[$i]&"|") GUICtrlSetData($PasswordsList, $pwds[$i]&"|") Next Else MsgBox(16, "bRO - Devotion:error", "Either accounts or password files weren't found.") EndIf EndFunc Edited March 3, 2012 by megablox "The story of a blade is linked in Blood." ―Yasuo Link to comment Share on other sites More sharing options...
water Posted March 3, 2012 Share Posted March 3, 2012 (edited) Is the semicolon in your code? ; Global $MaxAccs=5 If it is then this statement is a comment and hence the variable is not defined. Edited March 3, 2012 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Khryus Posted March 3, 2012 Author Share Posted March 3, 2012 No, there's no semicolon :< "The story of a blade is linked in Blood." ―Yasuo Link to comment Share on other sites More sharing options...
water Posted March 3, 2012 Share Posted March 3, 2012 I have to leave now but will have a look at your code later! My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Khryus Posted March 3, 2012 Author Share Posted March 3, 2012 (edited) Okay, thanks. I'll just take a break then.Bye! Edited March 3, 2012 by megablox "The story of a blade is linked in Blood." ―Yasuo Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 3, 2012 Moderators Share Posted March 3, 2012 Hi, megablox. Can you give some more info on the app, that may be part of your issue. I see Blackout RO Bot in your program files. Is this for Ragnarok online, or is it something else? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
water Posted March 3, 2012 Share Posted March 3, 2012 @JLogan3o13Good point.@megabloxI hope you've read the forum rules, if not you can find them here. Make sure you read the part regarding games thoroughly. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Khryus Posted March 3, 2012 Author Share Posted March 3, 2012 @water Yes, I know I can't do bots. This is just a simple auto-login macro, nothing else. I am not that skilled to make a bot. @JLogan Yes, this is related to Ragnarok Online. What I was doing here is create a GUI, then have it automatically load the usernames and passwords from a list, then you would choose the account you wanted to log with and click a button, then the login process would automate. That's all, but it doesn't seem to work "The story of a blade is linked in Blood." ―Yasuo Link to comment Share on other sites More sharing options...
water Posted March 3, 2012 Share Posted March 3, 2012 The forum rules include this sentence:"SPAM tools including instant messenger or forum auto-posters. This includes forum or site auto-login methods."I emphasized the important part relating to this thread.I'm not sure how a Mod sees it but I fear this thread will soon be locked. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 3, 2012 Moderators Share Posted March 3, 2012 megablox,This is just a simple auto-login macroYes, this is related to Ragnarok OnlineSo you break the Forum Rules on 2 counts. Make sure you read and understand them before you post again. 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