help variable Topic is solved
Re: help variable
If you mean after choosing Load from the menu, it still shows the MsgBox after I load it and then click on it. Are you expecting it to run bruna without even clicking on it after you load it? It doesn’t run the code at the label based on whether it’s checked or not. It runs it when it gets clicked on.
Re: help variable
ahh, how can I load the checkbox function as soon as I load it?boiler wrote: ↑18 Apr 2021, 23:03If you mean after choosing Load from the menu, it still shows the MsgBox after I load it and then click on it. Are you expecting it to run bruna without even clicking on it after you load it? It doesn’t run the code at the label based on whether it’s checked or not. It runs it when it gets clicked on.
Re: help variable
You put code in that checks the value of the checkbox when you load the values from the ini file, then uses Gosub to execute the subroutine if it’s checked.
Re: help variable
can you give me an example in this code?
Code: Select all
Gui Add, CheckBox, x280 y80 w73 h23 vruna gbruna , Rune
Gui Show, w439 h274, test
bruna:
gui,submit,nohide
If (runa=1){
settimer,runa,500
GuiControl, Disable, key
GuiControl, Disable, manaa
}
else
{
settimer,runa,OFF ;check = 0 so dont loop
GuiControl, enable, key
GuiControl, enable, manaa
}
return
runa:
Gui, Submit, Nohide
if (runa)
{
SetFormat, float, 0.0
if mana > %manaa%
{
ControlSend,,{%key%}, %namechar%
Sleep, 1000
}}
return
load:
IniRead, runa, %SelectedFile%, bot variables, runa
GuiControl,, runa, %runa%
return
save:
GuiControlGet, runa,, runa
IniWrite, %runa%, %SelectedFile%, bot variables, runa
return
Re: help variable
Code: Select all
load:
IniRead, runa, %SelectedFile%, bot variables, runa
GuiControl,, runa, %runa%
if runa
gosub, bruna
return
Re: help variable
ty ty ty ty ^^boiler wrote: ↑18 Apr 2021, 23:23Code: Select all
load: IniRead, runa, %SelectedFile%, bot variables, runa GuiControl,, runa, %runa% if runa gosub, bruna return
Re: help variable
I have one more problem how do I load a code like that?boiler wrote: ↑18 Apr 2021, 23:23Code: Select all
load: IniRead, runa, %SelectedFile%, bot variables, runa GuiControl,, runa, %runa% if runa gosub, bruna return
he does not accept the foodx and foody pos from iniread
Code: Select all
foodd:
gui,submit,nohide
if (foodd)
{
{
global client_id := namechar
DllCall("Data\mousehook64.dll\RightClick", "AStr", client_id, "INT", foodx , "INT", foody -25)
}}
return
Re: help variable
Just do the same thing for those checkboxes. If they’re checked then gosub to their subroutines.
Re: help variable
@boiler
it saves the position in the config.ini but when loing it doesn’t read the foodx and foody positions why?
do I have to put a gui, edit for him to read?
code pos x and y
Code: Select all
#SingleInstance,Force
#NoEnv
#WinActivateForce ; need to test it
Gui Add, CheckBox, x280 y128 w82 h23 vfoodd gbfoodd, Food
Gui Add, Button, x144 y96 w68 h28 ggetpos_life_1 vgetpos_life_1, Pos Food
Gui Show, w439 h274, test
return
bfoodd:
If (foodd=1)
settimer,foodd,9000
else
settimer,foodd,OFF
return
foodd:
gui,submit,nohide
if (foodd)
{
{
global client_id := namechar
DllCall("Data\mousehook64.dll\RightClick", "AStr", client_id, "INT", foodx , "INT", foody -25)
}}
return
getpos_life_1:
CoordMode, ToolTip, Window
CoordMode, Mouse, Window
CoordMode, Pixel, Window
WinActivate, %namechar%
WinMinimize, ahk_id %MainBotWindow%
SetColor()
return
SetColor(){
While(!GetKeyState("ctrl")){
ToolTip,Press ""Ctrl"" to set Search Food
MouseGetPos,foodx,foody,
}
ToolTip,
WinActivate, ahk_id %MainBotWindow%
}
return
load:
IniRead, foodx, %SelectedFile%, bot variables, foodx
IniRead, foody, %SelectedFile%, bot variables, foody
if foodd
gosub, bfoodd
return
save(){
IniWrite, %foody%, %SelectedFile%, bot variables, foody
IniWrite, %foodx%, %SelectedFile%, bot variables, foodx
}
return
GuiEscape:
GuiClose:
ExitApp
Code: Select all
[bot variables]
foody=335
foodx=1296
Re: help variable Topic is solved
The lines below result in foodx not being read from the .ini file:
The if statement says to only execute the line following it if the SelectedFile variable is empty. Since it is not (otherwise none of the variables could be read since you haven’t selected the file), then the IniRead, foodx... line doesn’t get executed. The only way that if statement makes sense is if it’s followed by return or something like that, as shown here:
Code: Select all
if (SelectedFile = "")
IniRead, foodx, %SelectedFile%, bot variables, foodx
IniRead, foody, %SelectedFile%, bot variables, foody
The if statement says to only execute the line following it if the SelectedFile variable is empty. Since it is not (otherwise none of the variables could be read since you haven’t selected the file), then the IniRead, foodx... line doesn’t get executed. The only way that if statement makes sense is if it’s followed by return or something like that, as shown here:
Code: Select all
if (SelectedFile = "")
return
IniRead, foodx, %SelectedFile%, bot variables, foodx
IniRead, foody, %SelectedFile%, bot variables, foody
Re: help variable
It looks like your code has changed since the version I just pulled lines from. You should post your full code as it currently stands. There is only so much review and debugging I can do of your hundreds of lines of code, though.
Re: help variable
ok,
my full code
something else on that RegExMatch line has to accept only words like a to z
why he should only check names, not symbols
Last edited by theon on 19 Apr 2021, 23:12, edited 1 time in total.
Re: help variable
What do you mean only check names? It checks ReadEOClient1 to ReadEOClient11 for those symbols because that’s what you said you wanted it to do. What are you saying it should do instead?
Re: help variable
You still have these lines in for no reason:
Code: Select all
#include gdip.ahk
;Start up gdip
pToken := Gdip_Startup()
Re: help variable
in this if you can only pass examples names:
dragon lord
dragon
Rat
Cave Rat
not names with numbers and symbols
example:
Ca? E Rat
Frog#
ra3
^ at
this is bad can't
Re: help variable
Code: Select all
I forgot to deleteboiler wrote: ↑19 Apr 2021, 21:11You still have these lines in for no reason:Code: Select all
#include gdip.ahk ;Start up gdip pToken := Gdip_Startup()
Re: help variable
One thing I see is that you attempt to get the values of foodx and foody in this function:
...but they are local to that function only because you did not declare them as global variables like you did for many others.
Code: Select all
SetColor(){
While(!GetKeyState("ctrl")){
ToolTip,Press ""Ctrl"" to set Search Food
MouseGetPos,foodx,foody,
}
ToolTip,
WinActivate, ahk_id %MainBotWindow%
}
return
Re: help variable
boiler wrote: ↑19 Apr 2021, 21:19One thing I see is that you attempt to get the values of foodx and foody in this function:...but they are local to that function only because you did not declare them as global variables like you did for many others.Code: Select all
SetColor(){ While(!GetKeyState("ctrl")){ ToolTip,Press ""Ctrl"" to set Search Food MouseGetPos,foodx,foody, } ToolTip, WinActivate, ahk_id %MainBotWindow% } return
this part I tested and is working normal
Re: help variable
Do you mean the following line?
Code: Select all
if !RegExMatch(ReadEOClient%A_Index%, "[\^?$%#@]")
Who is online
Users browsing this forum: Chunjee, helloicanseeu and 260 guests