Sign in to follow this  
Followers 0
SteveO

HELP WITH FUNCTION!

20 posts in this topic

#1 ·  Posted (edited)

Okay, so I'm having my function read my GUI List, then changing the values according to what it read in the GUI, then I call the function in my main program and output it to a message box, now I'm not sure if I'm just not outputting it correctly or if it's just not reading the GUIList, cause the output is always blank.

Main Program

#include <version.au3>
#include <arraylist.au3>
#include <topicselection.au3>
#include <IE.au3>
#include <GUIConstants.au3>
#include <Math.au3>
#include <File.au3>
#include <Array.au3>
#include <Func.au3>
#include <INet.au3>
Global $Euser
Global $Epass
Global $I
Global $ver
Global $topicnumber

FileInstall ("catalysticon.jpg","catalysticon.jpg")
FileInstall ("catalystsplash.jpg","catalystsplash.jpg")


    ;;Checks Messages File
     Dim $aMessages
    _FileReadToArray("messages.txt",$aMessages)

;;Variable Initiation
$Username   =  GUICtrlRead($Euser)
$Password   =  GUICtrlRead($Epass)
$Exit      =  1
$s_url = "http://neopets.com/loginpage.phtml"

$destination = "catalystsplash.jpg"
SplashImageOn("Catalyst NeoSpammer v" & $ver, $destination,396,406)
SoundPlay(@WindowsDir & "\media\tada.wav",1)
Sleep(800)
SplashOff()

;; Graphical User Interface
$gui = GUICreate("Catalyst NeoSpammer v" & $ver, 633, 386, 193, 115)
$Label1 = GUICtrlCreateLabel("Catalyst Neo Spammer v" & $ver, 16, 8, 135, 17)
$Label2 = GUICtrlCreateLabel("Created by : Catalyst", 16, 24, 101, 17)
$Label3 = GUICtrlCreateLabel("USERNAME :", 24, 56, 71, 17)
$Euser = GUICtrlCreateInput("", 24, 72, 121, 21)
$Label4 = GUICtrlCreateLabel("PASSWORD : ", 24, 104, 76, 17)
$Epass = GUICtrlCreateInput("", 24, 120, 121, 21)
$Login = GUICtrlCreateGroup("Login", 16, 40, 145, 113)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$List1 = GUICtrlCreateList("", 176, 24, 177, 344)
$DataList1 = _ArrayToString($aList1, "|", 0)
GUICtrlSetData($List1,$DataList1,"")
$Topics = GUICtrlCreateGroup("Forum Topics", 168, 8, 193, 369)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group1 = GUICtrlCreateGroup("Messages", 368, 8, 257, 369)
$List2 = GUICtrlCreateList("", 376, 24, 241, 344)
$DataList2 = _ArrayToString($aMessages, "|", 1)
GUICtrlSetData($List2,$DataList2,"")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Submit = GUICtrlCreateButton("START", 48, 176, 75, 25, 0)
$Pic1 = GUICtrlCreatePic("catalystsplash.jpg", 24, 216, 129, 161, BitOR($SS_NOTIFY,$WS_GROUP))
GUISetState(@SW_SHOW)




;;Run Loop
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Submit
        Call("topicselection")
        MsgBox(0, "Test", $topicnumber)
        Begin()
        
    Case Else
        $Username   =  GUICtrlRead($Euser)
        $Password   =  GUICtrlRead($Epass)
       ;;;;;;;
    EndSelect
WEnd
Exit
While $Exit = 1
    Sleep(100)
WEndoÝ÷ Ø[§rب*y«­¢+ÙչѽÁ¥Í±Ñ¥½¸ ÀÌØíѽÁ¥¹ÕµÈ¤((ÀÌØíÑѽÁ¥ôU%
ÑɱI ÀÌØí±¥ÍÐĤ()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÁtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÁt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÅtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÅt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÉtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÉt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÍtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÍt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÑtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÑt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÕtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÕt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÙtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÙt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÝtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÝt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlátQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­Ílát)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlåtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­Ílåt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÄÁtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÄÁt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÄÅtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÄÅt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÄÉtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÄÉt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÄÍtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÄÍt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÄÑtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÄÑt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÄÕtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÄÕt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÄÙtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÄÙt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÄÝtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÄÝt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÄátQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÄát)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÄåtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÄåt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÈÁtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÈÁt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÈÅtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÈÅt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÈÉtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÈÉt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÈÍtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÈÍt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÈÑtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÈÑt)¹%()%ÀÌØíÑѽÁ¥ôôÀÌØí1¥ÍÐÅlÈÕtQ¡¸($ÀÌØíѽÁ¥¹ÕµÈôÀÌØíQ½Á¥1¥¹­ÍlÈÕt)¹%()¹Õ¹
Edited by SteveO

Share this post


Link to post
Share on other sites



More code to be assist with?..Also don't use caps.

Share this post


Link to post
Share on other sites

More code to be assist with?..Also don't use caps.

Added more code.


Share this post


Link to post
Share on other sites

Rather using Call("Function"), just use topicselection($the number) since you have optional parameter.

Share this post


Link to post
Share on other sites

Rather using Call("Function"), just use topicselection($the number) since you have optional parameter.

Reaplced
Call("topicselection")oÝ÷ Û­«­¢+ÙѽÁ¥Í±Ñ¥½¸ ÀÌØíѽÁ¥¹ÕµÈ
still just outputs blank :/

Share this post


Link to post
Share on other sites

Rather making includes you might just want to put that function in, because i am not sure if GUICtrlRead is able to perform.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Rather making includes you might just want to put that function in, because i am not sure if GUICtrlRead is able to perform.

Still Outputs Blank :/

New Code

#include <version.au3>
#include <arraylist.au3>
;#include <topicselection.au3>
#include <IE.au3>
#include <GUIConstants.au3>
#include <Math.au3>
#include <File.au3>
#include <Array.au3>
#include <Func.au3>
#include <INet.au3>
Global $Euser
Global $Epass
Global $I
Global $ver
Global $topicnumber

FileInstall ("catalysticon.jpg","catalysticon.jpg")
FileInstall ("catalystsplash.jpg","catalystsplash.jpg")


    ;;Checks Messages File
     Dim $aMessages
    _FileReadToArray("messages.txt",$aMessages)

;;Variable Initiation
$Username   =  GUICtrlRead($Euser)
$Password   =  GUICtrlRead($Epass)
$Exit      =  1
$s_url = "http://neopets.com/loginpage.phtml"

$destination = "catalystsplash.jpg"
SplashImageOn("Catalyst NeoSpammer v" & $ver, $destination,396,406)
SoundPlay(@WindowsDir & "\media\tada.wav",1)
Sleep(800)
SplashOff()

;; Graphical User Interface
$gui = GUICreate("Catalyst NeoSpammer v" & $ver, 633, 386, 193, 115)
$Label1 = GUICtrlCreateLabel("Catalyst Neo Spammer v" & $ver, 16, 8, 135, 17)
$Label2 = GUICtrlCreateLabel("Created by : Catalyst", 16, 24, 101, 17)
$Label3 = GUICtrlCreateLabel("USERNAME :", 24, 56, 71, 17)
$Euser = GUICtrlCreateInput("", 24, 72, 121, 21)
$Label4 = GUICtrlCreateLabel("PASSWORD : ", 24, 104, 76, 17)
$Epass = GUICtrlCreateInput("", 24, 120, 121, 21)
$Login = GUICtrlCreateGroup("Login", 16, 40, 145, 113)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$List1 = GUICtrlCreateList("", 176, 24, 177, 344)
$DataList1 = _ArrayToString($aList1, "|", 0)
GUICtrlSetData($List1,$DataList1,"")
$Topics = GUICtrlCreateGroup("Forum Topics", 168, 8, 193, 369)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group1 = GUICtrlCreateGroup("Messages", 368, 8, 257, 369)
$List2 = GUICtrlCreateList("", 376, 24, 241, 344)
$DataList2 = _ArrayToString($aMessages, "|", 1)
GUICtrlSetData($List2,$DataList2,"")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Submit = GUICtrlCreateButton("START", 48, 176, 75, 25, 0)
$Pic1 = GUICtrlCreatePic("catalystsplash.jpg", 24, 216, 129, 161, BitOR($SS_NOTIFY,$WS_GROUP))
GUISetState(@SW_SHOW)




;;Run Loop
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Submit
        topicselection($topicnumber)
        MsgBox(0, "Test", $topicnumber)
        Begin()
        
    Case Else
        $Username   =  GUICtrlRead($Euser)
        $Password   =  GUICtrlRead($Epass)
       ;;;;;;;
    EndSelect
WEnd
Exit
While $Exit = 1
    Sleep(100)
WEnd










Func topicselection ($topicnumber)

$gettopic = GUICtrlRead($list1)
$topicnumber = 0

If $gettopic == $aList1[0] Then
    $topicnumber = $aTopicLinks[0]
EndIF

If $gettopic == $aList1[1] Then
    $topicnumber = $aTopicLinks[1]
EndIF

If $gettopic == $aList1[2] Then
    $topicnumber = $aTopicLinks[2]
EndIF

If $gettopic == $aList1[3] Then
    $topicnumber = $aTopicLinks[3]
EndIF

If $gettopic == $aList1[4] Then
    $topicnumber = $aTopicLinks[4]
EndIF

If $gettopic == $aList1[5] Then
    $topicnumber = $aTopicLinks[5]
EndIF

If $gettopic == $aList1[6] Then
    $topicnumber = $aTopicLinks[6]
EndIF

If $gettopic == $aList1[7] Then
    $topicnumber = $aTopicLinks[7]
EndIF

If $gettopic == $aList1[8] Then
    $topicnumber = $aTopicLinks[8]
EndIF

If $gettopic == $aList1[9] Then
    $topicnumber = $aTopicLinks[9]
EndIF

If $gettopic == $aList1[10] Then
    $topicnumber = $aTopicLinks[10]
EndIF

If $gettopic == $aList1[11] Then
    $topicnumber = $aTopicLinks[11]
EndIF

If $gettopic == $aList1[12] Then
    $topicnumber = $aTopicLinks[12]
EndIF

If $gettopic == $aList1[13] Then
    $topicnumber = $aTopicLinks[13]
EndIF

If $gettopic == $aList1[14] Then
    $topicnumber = $aTopicLinks[14]
EndIF

If $gettopic == $aList1[15] Then
    $topicnumber = $aTopicLinks[15]
EndIF

If $gettopic == $aList1[16] Then
    $topicnumber = $aTopicLinks[16]
EndIF

If $gettopic == $aList1[17] Then
    $topicnumber = $aTopicLinks[17]
EndIF

If $gettopic == $aList1[18] Then
    $topicnumber = $aTopicLinks[18]
EndIF

If $gettopic == $aList1[19] Then
    $topicnumber = $aTopicLinks[19]
EndIF

If $gettopic == $aList1[20] Then
    $topicnumber = $aTopicLinks[20]
EndIF

If $gettopic == $aList1[21] Then
    $topicnumber = $aTopicLinks[21]
EndIF

If $gettopic == $aList1[22] Then
    $topicnumber = $aTopicLinks[22]
EndIF

If $gettopic == $aList1[23] Then
    $topicnumber = $aTopicLinks[23]
EndIF

If $gettopic == $aList1[24] Then
    $topicnumber = $aTopicLinks[24]
EndIF

If $gettopic == $aList1[25] Then
    $topicnumber = $aTopicLinks[25]
EndIF

EndFunc
Edited by SteveO

Share this post


Link to post
Share on other sites

Where did you obtain the topic number? You only global it but nothing is in the variable.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Where did you obtain the topic number? You only global it but nothing is in the variable.

in the function. It first esablishes $topicnumber as 0, then it uses IF Statements to compare what was read from the GUI, then it matches a result to an array from the array list and esablishes a topic number.

Snippett From Function

If $gettopic == $aList1[0] Then
    $topicnumber = $aTopicLinks[0]
EndIFoÝ÷ Ùªëk)b²Ö®¶­sb6æ6ÇVFRfÇC´'&æS2fwC° ¤FÒb33c¶Æ7C³#eÐ ¢b33c¶Æ7C³ÒÒgV÷C´ÄÂDõ52gV÷C°¢b33c¶Æ7C³ÒÒgV÷C´ÇFF÷"7WgV÷C°¢b33c¶Æ7C³%ÒÒgV÷C´fF'2òæV÷6væGW&W2gV÷C°¢b33c¶Æ7C³5ÒÒgV÷C´&GFÆVFöÖRgV÷C°¢b33c¶Æ7C³EÒÒgV÷C´&VWG6öçFW7BgV÷C°¢b33c¶Æ7C³UÒÒgV÷C´7W7FöÖ6FöâgV÷C°¢b33c¶Æ7C³eÒÒgV÷C´WfÂFæw2æBÖöç7FW"6vFæw2gV÷C°¢b33c¶Æ7C³uÒÒgV÷C´fæ6ÇV'2gV÷C°¢b33c¶Æ7C³ÒÒgV÷C´vÖW2gV÷C°¢b33c¶Æ7C³ÒÒgV÷C´wVÆG2gV÷C°¢b33c¶Æ7C³ÒÒgV÷C´VÇgV÷C°¢b33c¶Æ7C³ÒÒgV÷C´FV2ò7VvvW7Föç2gV÷C°¢b33c¶Æ7C³%ÒÒgV÷C´ÖW&6æF6ærgV÷C°¢b33c¶Æ7C³5ÒÒgV÷C´ä2ÖÆÂgV÷C°¢b33c¶Æ7C³EÒÒgV÷C´æV÷WG2G&Fær6&BvÖRgV÷C°¢b33c¶Æ7C³UÒÒgV÷C´æV÷âw&FW'2gV÷C°¢b33c¶Æ7C³eÒÒgV÷C´æV÷VW7B²æV÷VW7BgV÷C°¢b33c¶Æ7C³uÒÒgV÷C´æWv&W2gV÷C°¢b33c¶Æ7C³ÒÒgV÷C´÷FW"&ÆG2gV÷C°¢b33c¶Æ7C³ÒÒgV÷CµVW7G2gV÷C°¢b33c¶Æ7C³#ÒÒgV÷Cµ&öÆRÆærgV÷C°¢b33c¶Æ7C³#ÒÒgV÷Cµ6÷G2gV÷C°¢b33c¶Æ7C³#%ÒÒgV÷Cµ7÷FÆvG2æBvÆÆW&W2gV÷C°¢b33c¶Æ7C³#5ÒÒgV÷Cµ7Fö6²F2gV÷C°¢b33c¶Æ7C³#EÒÒgV÷CµG&FæròV7Föç2gV÷C°¢b33c¶Æ7C³#UÒÒgV÷Cµf'GWWG2gV÷C°  ¤FÒb33c¶F÷4Ææ·5³#eÐ ¢b33c¶F÷4Ææ·5³ÒÒb33c¶F÷4Ææ·5²&æFöÒÂ#RÂТb33c¶F÷4Ææ·5³ÒÒgV÷C³rgV÷C°¢b33c¶F÷4Ææ·5³%ÒÒgV÷C³#gV÷C°¢b33c¶F÷4Ææ·5³5ÒÒgV÷C³gV÷C°¢b33c¶F÷4Ææ·5³EÒÒgV÷C³2gV÷C°¢b33c¶F÷4Ææ·5³UÒÒgV÷C³#RgV÷C°¢b33c¶F÷4Ææ·5³eÒÒgV÷C³rgV÷C°¢b33c¶F÷4Ææ·5³uÒÒgV÷C³gV÷C°¢b33c¶F÷4Ææ·5³ÒÒgV÷C³#2gV÷C°¢b33c¶F÷4Ææ·5³ÒÒgV÷C³gV÷C°¢b33c¶F÷4Ææ·5³ÒÒgV÷C³RgV÷C°¢b33c¶F÷4Ææ·5³ÒÒgV÷C³"gV÷C°¢b33c¶F÷4Ææ·5³%ÒÒgV÷C³#BgV÷C°¢b33c¶F÷4Ææ·5³5ÒÒgV÷C³3gV÷C°¢b33c¶F÷4Ææ·5³EÒÒgV÷C³#gV÷C°¢b33c¶F÷4Ææ·5³UÒÒgV÷C³2gV÷C°¢b33c¶F÷4Ææ·5³eÒÒgV÷C³bgV÷C°¢b33c¶F÷4Ææ·5³uÒÒgV÷C³BgV÷C°¢b33c¶F÷4Ææ·5³ÒÒgV÷C³RgV÷C°¢b33c¶F÷4Ææ·5³ÒÒgV÷C³gV÷C°¢b33c¶F÷4Ææ·5³#ÒÒgV÷C³BgV÷C°¢b33c¶F÷4Ææ·5³#ÒÒgV÷C³gV÷C°¢b33c¶F÷4Ææ·5³#%ÒÒgV÷C³#"gV÷C°¢b33c¶F÷4Ææ·5³#5ÒÒgV÷C³"gV÷C°¢b33c¶F÷4Ææ·5³#EÒÒgV÷C³bgV÷C°¢b33c¶F÷4Ææ·5³#UÒÒgV÷C³gV÷C
Edited by SteveO

Share this post


Link to post
Share on other sites

Hmmm. Does GUICtrlRead, read the entire list? Or does it just read my selection on the list? Because that could be the problem....


Share this post


Link to post
Share on other sites

Hmmm. Does GUICtrlRead, read the entire list? Or does it just read my selection on the list? Because that could be the problem....

Returns depending the control (see below).

  • Checkbox - Radio state of the button. See State table
  • Combo, List - The value selected

Share this post


Link to post
Share on other sites

Blah....okay, so that's not the problem....


Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

I'd be willing to send the entire project in a Zip or Rar file to anyone that thinks they can help.

Edited by SteveO

Share this post


Link to post
Share on other sites

Update...

The GUICtrlRead, is reading the list perfectly. So the problem lies somewhere in between how the function is receiving the data, or how the data is being outputted from the function. Any suggestions?


Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Update...

The GUICtrlRead, is reading the list perfectly. So the problem lies somewhere in between how the function is receiving the data, or how the data is being outputted from the function. Any suggestions?

Well, first reduce that function to this:

Func topicselection($topicnumber)
    $gettopic = GUICtrlRead($list1)
    ConsoleWrite("Debug: $gettopic = " & $gettopic & @LF)
    $topicnumber = 0
    For $n = 0 To UBound($aList1) - 1
        If $gettopic == $aList1[$n] Then
            $topicnumber = $aTopicLinks[$n]
            ConsoleWrite("Debug: $topicnumber = " & $topicnumber & @LF)
            ExitLoop
        EndIf
    Next
    If $topicnumber = 0 Then ConsoleWrite("Debug: No match found, $topicnumber = 0" & @LF)
EndFunc   ;==>topicselectionoÝ÷ Ù8^
ì¢W®+^ßÛ,¥v¥¥ø º·¨ºÛaz+,¹áÒ-)äÊ¡j÷Zj_Ë¡Æ¥½ªâi¹^'-Â+aÓ~­¢éz¶(¹ªÞq©ex-çîËb¢ybëaÌ!Èb±©ky§rjX­¶W°z*Ýjëh×6        Call("topicselection")
        MsgBox(0, "Test", $topicnumber)
        Begin()oÝ÷ ØÚ-Ç­«BjY]¡ë'ßÛijË*Z­©µêìN§~éܶ*'ÂÞº-y¦è½ç^rV«zÍ7êÚ)Éî·«jƧzn¶«jg­z¼!Èr¢éÞ½êé®âuç@4

Now it should work.

:)

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Well, first reduce that function to this:

Func topicselection($topicnumber)
    $gettopic = GUICtrlRead($list1)
    ConsoleWrite("Debug: $gettopic = " & $gettopic & @LF)
    $topicnumber = 0
    For $n = 0 To UBound($aList1) - 1
        If $gettopic == $aList1[$n] Then
            $topicnumber = $aTopicLinks[$n]
            ConsoleWrite("Debug: $topicnumber = " & $topicnumber & @LF)
            ExitLoop
        EndIf
    Next
    If $topicnumber = 0 Then ConsoleWrite("Debug: No match found, $topicnumber = 0" & @LF)
EndFunc   ;==>topicselectionoÝ÷ Ù8^
ì¢W®+^ßÛ,¥v¥¥ø º·¨ºÛaz+,¹áÒ-)äÊ¡j÷Zj_Ë¡Æ¥½ªâi¹^'-Â+aÓ~­¢éz¶(¹ªÞq©ex-çîËb¢ybëaÌ!Èb±©ky§rjX­¶W°z*Ýjëh×6        Call("topicselection")
        MsgBox(0, "Test", $topicnumber)
        Begin()oÝ÷ ØÚ-Ç­«BjY]¡ë'ßÛijË*Z­©µêìN§~éܶ*'ÂÞº-y¦è½ç^rV«zÍ7êÚ)Éî·«jƧzn¶«jg­z¼!Èr¢éÞ½êé®âuç@4<"VÞ.Ú-çîËb¢r-)䶭ßÛ0,¨¹ªÞ`zÛbazö¥¹æÚrH§Ó~­¢éz±b®Ë_¨º·V®¶­sbb33c·F÷6çVÖ&W"ÒF÷76VÆV7Föâ¢×6t&÷ÂgV÷CµFW7BgV÷C²Âb33c·F÷6çVÖ&W"¢&VvâoÝ÷ Ù8^ayû§rبÚ.±æ¥¡Æ¥½ªâi¹^{^®v¥&®¶­sdgVæ2F÷76VÆV7Föâ b33c¶vWGF÷2ÒuT7G&Å&VBb33c¶Æ7C 6öç6öÆUw&FRgV÷C´FV'Vs¢b33c¶vWGF÷2ÒgV÷C²fײb33c¶vWGF÷2fײÄb Æö6Âb33c¶F÷2Ò f÷"b33c¶âÒFòT&÷VæBb33c¶Æ7CÒ bb33c¶vWGF÷2ÓÒb33c¶Æ7C²b33c¶åÒFVà b33c¶F÷2Òb33c¶F÷4Ææ·5²b33c¶åÐ 6öç6öÆUw&FRgV÷C´FV'Vs¢b33c¶F÷2ÒgV÷C²fײb33c¶F÷2fײÄb WDÆö÷ VæD` æW@ bb33c¶F÷2ÒFVâ6öç6öÆUw&FRgV÷C´FV'Vs¢æòÖF6f÷VæBÂb33c¶F÷2ÒgV÷C²fײÄb &WGW&âb33c¶F÷0¤VæDgVæ2³ÓÒfwC·F÷76VÆV7Fö

Now it should work.

:)

YOU......ARE.......GOD!!!!!!

Thank you SO much for the help!


Share this post


Link to post
Share on other sites

Another problem, sorry! :/

Okay the first option in my array does not return anything.

$aTopicLinks[1] = $aTopicLinks[(Random(2, 26, 1))]
$aTopicLinks[2] = "7"
$aTopicLinks[3] = "21"
$aTopicLinks[4] = "10"
$aTopicLinks[5] = "13"
$aTopicLinks[6] = "25"
$aTopicLinks[7] = "17"
$aTopicLinks[8] = "1"
$aTopicLinks[9] = "23"
$aTopicLinks[10] = "8"
$aTopicLinks[11] = "5"
$aTopicLinks[12] = "2"
$aTopicLinks[13] = "24"
$aTopicLinks[14] = "31"
$aTopicLinks[15] = "20"
$aTopicLinks[16] = "3"
$aTopicLinks[17] = "16"
$aTopicLinks[18] = "4"
$aTopicLinks[19] = "15"
$aTopicLinks[20] = "9"
$aTopicLinks[21] = "14"
$aTopicLinks[22] = "11"
$aTopicLinks[23] = "22"
$aTopicLinks[24] = "12"
$aTopicLinks[25] = "6"
$aTopicLinks[26] = "19"

It's meant to pick a topic at random.....


Share this post


Link to post
Share on other sites

Another problem, sorry! :/

Okay the first option in my array does not return anything.

$aTopicLinks[1] = $aTopicLinks[(Random(2, 26, 1))]

It's meant to pick a topic at random.....

The rest of the array has not been initialized with any values yet. Set you values for all the rest first, then set that one at the end.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Another problem, sorry! :/

Okay the first option in my array does not return anything.

$aTopicLinks[1] = $aTopicLinks[(Random(2, 26, 1))]
$aTopicLinks[2] = "7"
$aTopicLinks[3] = "21"
$aTopicLinks[4] = "10"
$aTopicLinks[5] = "13"
$aTopicLinks[6] = "25"
$aTopicLinks[7] = "17"
$aTopicLinks[8] = "1"
$aTopicLinks[9] = "23"
$aTopicLinks[10] = "8"
$aTopicLinks[11] = "5"
$aTopicLinks[12] = "2"
$aTopicLinks[13] = "24"
$aTopicLinks[14] = "31"
$aTopicLinks[15] = "20"
$aTopicLinks[16] = "3"
$aTopicLinks[17] = "16"
$aTopicLinks[18] = "4"
$aTopicLinks[19] = "15"
$aTopicLinks[20] = "9"
$aTopicLinks[21] = "14"
$aTopicLinks[22] = "11"
$aTopicLinks[23] = "22"
$aTopicLinks[24] = "12"
$aTopicLinks[25] = "6"
$aTopicLinks[26] = "19"

It's meant to pick a topic at random.....

Because you're calling it before you create the values for the others :)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

The rest of the array has not been initialized with any values yet. Set you values for all the rest first, then set that one at the end.

:)

Because you're calling it before you create the values for the others :P

You guys are THE BOMB! I woulda been cracking my head open on that one for HOURS! THANKS!


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
Sign in to follow this  
Followers 0