Sign in to follow this  
Followers 0
ToXiCSoft

Help pls i get recursion error

3 posts in this topic

Can someone debug this pls

I get recursion error's

Thx :D

$var1 = MsgBox(4,"XSurfing","Do you wish to Start XSurfing Tool?")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\XSurfingTool", "WIN", "REG_SZ", "show" ) 

Select
Case $var1 = 6
Break(0)
HotKeySet("!^q","Clo")
HotKeySet("!^a","Ope")
HotKeySet("!^z","Np")
TrayTip("XSurfing", "XSurfing Tool Made by ToXiCSoft!" & @CRLF & "Quit = Alt + Control + Q" & @CRLF & "Start/Stop Popup Killing = Alt + Control + Z" & @CRLF & "Hide/Show XSurfing Window = Alt + Control + Q", 5, 1)
kill()
EndSelect



Func Kill()
$titel1 = "Free Emoticons. Choose your favorite! - Microsoft Internet Explorer"
$titel2 = "FREE Emoticons - Microsoft Internet Explorer"
$titel3 = "Attention! - Microsoft Internet Explorer"
$titel4 = "Attention - Important Message - Microsoft Internet Explorer"
$titel5 = "Take off the pounds! - Microsoft Internet Explorer"
$titel6 = "http://ads1.revenue.net/load/206065/index.html?O_RANK=-1&O_CREATIVE_ID=206065&O_SITE_ID=12235& - Microsoft Internet Explorer"
$titel7 = "Beveiligingswaarschuwing"
$titel8 = "Free Emoticons! - Microsoft Internet Explorer"

$nr = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\XSurfingTool", "Nr")
$nk = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\XSurfingTool", "NK")
Do
;>>>>>

if WinExists( $titel1 ) = 1 then
WinClose( $titel1 )
$nr = $nr + 1
TrayTip("XSurfing", "Killed " & $nr & " Windows So Far!", 5, 1)
Sleep(500)
EndIf
if WinExists( $titel2 ) = 1 then
WinClose( $titel2 )
$nr = $nr + 1
TrayTip("XSurfing", "Killed " & $nr & " Windows So Far!", 5, 1)
Sleep(500)
EndIf
if WinExists( $titel3 ) = 1 then
WinClose( $titel3 )
$nr = $nr + 1
TrayTip("XSurfing", "Killed " & $nr & " Windows So Far!", 5, 1)
Sleep(500)
EndIf
if WinExists( $titel4 ) = 1 then
WinClose( $titel4 )
$nr = $nr + 1
TrayTip("XSurfing", "Killed " & $nr & " Windows So Far!", 5, 1)
Sleep(500)
EndIf
if WinExists( $titel5 ) = 1 then
WinClose( $titel5 )
$nr = $nr + 1
TrayTip("XSurfing", "Killed " & $nr & " Windows So Far!", 5, 1)
Sleep(500)
EndIf
if WinExists( $titel6 ) = 1 then
WinClose( $titel6 )
$nr = $nr + 1
TrayTip("XSurfing", "Killed " & $nr & " Windows So Far!", 5, 1)
Sleep(500)
EndIf
if WinExists( $titel7 ) = 1 then
WinClose( $titel7 )
$nr = $nr + 1
TrayTip("XSurfing", "Killed " & $nr & " Windows So Far!", 5, 1)
Sleep(500)
EndIf
if WinExists( $titel8 ) = 1 then
WinClose( $titel8 )
$nr = $nr + 1
TrayTip("XSurfing", "Killed " & $nr & " Windows So Far!", 5, 1)
Sleep(500)
EndIf

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\XSurfingTool", "Nr", "REG_SZ", $nr )
;<<<<<
Until $nk = 0

Kill2()
EndFunc

Func Kill2()
Do
;>>>>>
$nk = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\XSurfingTool", "NK")
Sleep(2000)
Kill2()
;<<<<<
Until $nk = 1
Kill()
EndFunc

Func Clo()
$var2 = MsgBox(4,"XSurfing","Close XSurfing Tool?")
If $var2 = 6 then
Exit
EndIf
EndFunc

Func Ope() 
$WIN = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\XSurfingTool", "WIN")
if $WIN = "hide" then
TrayTip("XSurfing", "Showing XSurfing window", 5, 1)
WinSetState("XSurfer! - Microsoft Internet Explorer","", @SW_SHOW )
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\XSurfingTool", "WIN", "REG_SZ", "show" )
EndIf
If $WIN = "show" then
TrayTip("XSurfing", "Hiding XSurfing window", 5, 1)
WinSetState("XSurfer! - Microsoft Internet Explorer","", @SW_HIDE )
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\XSurfingTool", "WIN", "REG_SZ", "hide" )
EndIf
EndFunc

Func Np()
$nk = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\XSurfingTool", "NK")
If $nk = 1 then
TrayTip("XSurfing", "Stopped Popup Killing!", 5, 1)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\XSurfingTool", "NK", "REG_SZ", 0 )
EndIf
If $nk = 0 then
TrayTip("XSurfing", "Started Popup Killing!", 5, 1)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\XSurfingTool", "NK", "REG_SZ", 1 )
EndIf
EndFunc

Share this post


Link to post
Share on other sites



As your code is setup depending the time you type the hotkey !^z the kill2 will call kill2 again and again so you will get a recursion error.

You need and other logic. Just describe what you want to achieve and we can help you. Sorry difficult to help if the goal is not clear :D

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Can someone debug this pls

I get recursion error's

Thx :huh2:

Didn't you say something like:

Think you have a flow issue in your logic.

You keep on calling Star() in stead of making Star() loop indefinately and doing a Return in stead of Star() from the other functions. You will get an Error in time telling you that you have too many recursions....,

BTW

I never ever got that error :)

And ive used this many many times :lol:

Well you are doing the same in this script.... so all i can say now is:

" I told you so" :D

have a look at the reply i added to your other post....

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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