Jump to content

Cannot set data to list after cleared?


Recommended Posts

I have a load button and a clear button on this, however, if I click the load button, then the clear button, then ADD, or load again, the script freezes up, I'm guessing its because after being cleared, te list cant be added to again?

Sorry, the code tages and autoit tags are messing up

#include <GUIConstants.au3>

#include <GuiList.au3>

#include <IE.au3>

HotKeySet("{esc}","exx")

$oIE = _IECreateEmbedded( )

$3 = 1

$Form1 = GUICreate("Page Refresher - By Vindicator", 681, 417, 193, 115)

$Pic1 = GUICtrlCreateObj($oIE, 8, 8, 473, 369)

$List1 = GUICtrlCreateList("", 488, 8, 185, 370)

$Button1 = GUICtrlCreateButton("Add", 488, 384, 185, 25, 0)

$Button2 = GUICtrlCreateButton("Load", 303, 384, 89, 25, 0)

$Button4 = GUICtrlCreateButton("Clear", 392, 384, 89, 25, 0)

$Button3 = GUICtrlCreateButton("Start", 8, 384, 201, 25, 0)

GUISetState(@SW_SHOW)

_IENavigate($oIE,"about:blank")

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $Button2

If FileExists("floodconfig.txt") Then

Do

$end=FileReadLine("floodconfig.txt",$3)

If $end = "::END" Then

Else

GUICtrlSetData($List1,$end)

EndIf

$3 = $3 + 1

Until $end = "::END"

Else

MsgBox(0,"Error","Config file does not exist")

EndIf

Case $Button4

_GUICtrlListClear($List1)

Case $Button1

$Add = InputBox("Add","Address to add:")

GUICtrlSetData($List1,$Add)

_IENavigate($oIE,$Add,0)

Case $Button3

$Times = InputBox("Flood","Send How Many Times?")

WinSetTitle("Page Refresher - By Vindicator","","Page Refresher - By Vindicator - PRESS ESC TO STOP")

$Lines = _GUICtrlListCount($List1)

$2 = 0

$1 = 0

Do

$2 = 0

Do

_IENavigate($oIE,_GUICtrlListGetText($List1,$2))

_IELoadWait($oIE)

$2 = $2 + 1

Until $2 = $Lines

$1 = $1 + 1

Until $1 = $Times

WinSetTitle("Page Refresher - By Vindicator - PRESS ESC TO STOP","","Page Refresher - By Vindicator")

Case $GUI_EVENT_CLOSE

$Lines = _GUICtrlListCount($List1)

$2 = 0

FileDelete("floodconfig.txt")

Do

FileWriteLine("floodconfig.txt",_GUICtrlListGetText($List1,$2))

$2 = $2 + 1

Until $2 = $Lines

FileWriteLine("floodconfig.txt","::END")

Exit

EndSwitch

WEnd

Func exx()

$l = $Lines

EndFunc

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

I have a load button and a clear button on this, however, if I click the load button, then the clear button, then ADD, or load again, the script freezes up, I'm guessing its because after being cleared, te list cant be added to again?

Sorry, the code tages and autoit tags are messing up

I think you need this

c2--><!--YzItLSYjNjI7JiM2MDsmIzMzOy0tQ2tOaGMyVWdKaU13TXpZN1FuVjÔUÑÚÓÖÓUÕUÙUÒRLRVZÙØQÓRZÑÑULÕSÄEvD¥få5Tä%£ÄEvD¥få5Tä%§wEuwå$SC7å£%EÓS%5Ud´Õu$V妦Æå9M9ÕU¹Á)MÁÍ]YM)ÑdÉ­ÀÉe±9
YÁai!  ¥QYÕMUÕU±!]¹   ¥HÅY¹]Y­a9ÍÑ1YjNjI7JiM2MDsmIzMzOy
tZWc=--><!--eg

Yes, the code tags are messed up, but you can add them yourself, just put autoit inside square brackets at the start of the code, then /autoit in square brackets at the end.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Can you repost that without the code tags, theyre all messed up, and thanks!

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

Can you repost that without the code tags, theyre all messed up, and thanks!

What I was trying to show was that after you clear the list you need to set $3 = 1 again, otherwise when you read the file you start reading after the ::END line.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...