Sign in to follow this  
Followers 0
jerwin

[HELP]CONTROLSEND WITH VARIABLES....

16 posts in this topic

please check this script... i think its something wrong here... i already run it in scite and i dont found any errors... and its working but only about 20%..

Func ShopName()
    $SHP1 = IniRead(@ScriptDir & "PriceSettings\P1.ini", "Prices", "ShopName", "")
    $SHP2 = IniRead(@ScriptDir & "PriceSettings\P2.ini", "Prices", "ShopName", "")
    $SHP3 = IniRead(@ScriptDir & "PriceSettings\P3.ini", "Prices", "ShopName", "")
    $SHP4 = IniRead(@ScriptDir & "PriceSettings\P4.ini", "Prices", "ShopName", "")
    $SHP5 = IniRead(@ScriptDir & "PriceSettings\P5.ini", "Prices", "ShopName", "")
    $SHP6 = IniRead(@ScriptDir & "PriceSettings\P6.ini", "Prices", "ShopName", "")
    $SHP7 = IniRead(@ScriptDir & "PriceSettings\P7.ini", "Prices", "ShopName", "")
    $SHP8 = IniRead(@ScriptDir & "PriceSettings\P8.ini", "Prices", "ShopName", "")
    $SHP9 = IniRead(@ScriptDir & "PriceSettings\P9.ini", "Prices", "ShopName", "")
    $SHP10 = IniRead(@ScriptDir & "PriceSettings\P10.ini", "Prices", "ShopName", "")
    $Shop1 = $SHP1
    $Shop2 = $SHP2
    $Shop3 = $SHP3
    $Shop4 = $SHP4
    $Shop5 = $SHP5
    $Shop6 = $SHP6
    $Shop7 = $SHP7
    $Shop8 = $SHP8
    $Shop9 = $SHP9
    $Shop10 = $SHP10
    If ($SHP1 = $Shop1) Then
        ControlSend("Dekaron", "", "", GUICtrlRead($SHP1))
    EndIf
EndFunc

[font="Arial Black"]Looking for a partner in making Perfect Bot for DEKARONPm me if you wanna join.....[/font]

Share this post


Link to post
Share on other sites



What exactly is the problem? You are only passing 1 variable. $Shop1 = $SHP1 does nothing. It is the same.

There is no need for the () in the If statement

If ($SHP1 = $Shop1) Then

becomes

If $SHP1 = $Shop1 Then

Cheers,

Brett

Share this post


Link to post
Share on other sites

Um.. well.. if you just simply assigned the IniRead commands directly to the $Shopx variables, then you wouldn't have to check to see if they matched. The If... Then statement you have there is always going to return true - might as well just remove it.

And what do you mean it's working only 20%?

Try this:

Func ShopName()
    $Shop1 = IniRead(@ScriptDir & "PriceSettings\P1.ini", "Prices", "ShopName", "")
    $Shop2 = IniRead(@ScriptDir & "PriceSettings\P2.ini", "Prices", "ShopName", "")
    $Shop3 = IniRead(@ScriptDir & "PriceSettings\P3.ini", "Prices", "ShopName", "")
    $Shop4 = IniRead(@ScriptDir & "PriceSettings\P4.ini", "Prices", "ShopName", "")
    $Shop5 = IniRead(@ScriptDir & "PriceSettings\P5.ini", "Prices", "ShopName", "")
    $Shop6 = IniRead(@ScriptDir & "PriceSettings\P6.ini", "Prices", "ShopName", "")
    $Shop7 = IniRead(@ScriptDir & "PriceSettings\P7.ini", "Prices", "ShopName", "")
    $Shop8 = IniRead(@ScriptDir & "PriceSettings\P8.ini", "Prices", "ShopName", "")
    $Shop9 = IniRead(@ScriptDir & "PriceSettings\P9.ini", "Prices", "ShopName", "")
    $Shop10 = IniRead(@ScriptDir & "PriceSettings\P10.ini", "Prices", "ShopName", "")
    ControlSend("Dekaron", "", "", GUICtrlRead($Shop1))
EndFunc

By the way, looking at the last line, your code makes no sense - $SHP1 in your code isn't a control, so therefore you cant 'read' it like a GUI control.

By the way, you should make one INI file with different sections pertaining to each shop.

Perhaps if you were to tell us what exactly your code should do, we could better help you?


Monkeh.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

What exactly is the problem? You are only passing 1 variable. $Shop1 = $SHP1 does nothing. It is the same.

There is no need for the () in the If statement

If ($SHP1 = $Shop1) Then

becomes

If $SHP1 = $Shop1 Then

Cheers,

Brett

thanx for that but still not working :) muttley

Edited by jerwin

[font="Arial Black"]Looking for a partner in making Perfect Bot for DEKARONPm me if you wanna join.....[/font]

Share this post


Link to post
Share on other sites

... Okay. You didn't... *quite* answer any questions. What do you want this code to do?


Monkeh.

Share this post


Link to post
Share on other sites

sorry for late reply....

this is wat i trying to do....

Posted Image


[font="Arial Black"]Looking for a partner in making Perfect Bot for DEKARONPm me if you wanna join.....[/font]

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

EDIT: Ooo, upon looking at your image again, I regret to tell you that that is not a real windows GUI. Therefore, that textbox isn't a real one, and the ControlSend function will not work on it.

However, if you can get AutoIt to click and activate the field, you can use Send() to send it the value like it was typed in using a keyboard.

-Monkeh

Edited by m0nk3yI3unz

Monkeh.

Share this post


Link to post
Share on other sites

Aha that helps a little. Did you try getting the text field's control ID with AutoIt window information utility? (Look in your AutoIt3 menu in the start menu). Also, check in the help file for information on ControlSend.

Best of luck!

sorry i dont get it but im using ini files for reading the text that as been saved at gui then its should be ... send at the game.... i dont know but i try to use control id but its not work maybe u can give me a good example.....


[font="Arial Black"]Looking for a partner in making Perfect Bot for DEKARONPm me if you wanna join.....[/font]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Read my edit.

EDIT: Ooo, upon looking at your image again, I regret to tell you that that is not a real windows GUI. Therefore, that textbox isn't a real one, and the ControlSend function will not work on it.

However, if you can get AutoIt to click and activate the field, you can use Send() to send it the value like it was typed in using a keyboard.

-Monkeh

Edited by m0nk3yI3unz

Monkeh.

Share this post


Link to post
Share on other sites

Read my edit.

sorry for late reply again im still looking for more solution...

how about this sir....

i think i can use controlsend or send something but i just dont know how to do it... dam im sick today... muttley

Posted Image


[font="Arial Black"]Looking for a partner in making Perfect Bot for DEKARONPm me if you wanna join.....[/font]

Share this post


Link to post
Share on other sites

No, sorry you cant. If you read my message, you would have seen the same thing Im about to tell you: This game you are playing is made using a graphics runtime such as DirectX or XNA (both ® or TM respectfully). Therefore, that game is run using ONE control in a GUI, which is a graphics box. This means it isn't structured like a regular GUI is; therefore, ControlSend would only work on the one control stated above - however, a control like that wont accept arguments, especially one directed at one of its own controls.

Now, again, you must activate the textbox within the game some other way - maybe using MouseClick() to make it click on the text box to make the cursor appear in it, then use Send() to send it the values of the textbox.


Monkeh.

Share this post


Link to post
Share on other sites

i see thanx for the info.... about clicking on the line in editing the name of shop i can use mouseclick yes its working but my problem its depends on the bot user to choose any name of shop so i thinking after i save the desire name that i put... it will read it and send on it i know i can use controlsend maybe i just need add some func... if in price/number working why in shopname/text will not work ryt???

btw thanx for the info muttley


[font="Arial Black"]Looking for a partner in making Perfect Bot for DEKARONPm me if you wanna join.....[/font]

Share this post


Link to post
Share on other sites

Like I said - just do something like

$name = "Some Name"
MouseClick("left",$x,$y) ; x and y being the textbox
send($name)

And, no, controlsend WILL NOT WORK.

And, no, controlsend WILL NOT WORK.

And, no, controlsend WILL NOT WORK.

And, no, controlsend WILL NOT WORK.

</rant>

Best of luck

-Monkeh


Monkeh.

Share this post


Link to post
Share on other sites

Have you seen the AutoIt v3 Window tool? If you can get the infomation of whats in the window, then usually you can control send it. Post a picture of the Au3 Window Control tab, and we should be able to do a short test, of just sending the text to the window. Then we can work out the rest. So in other words, we're going from scratch muttley

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Like I said - just do something like

$name = "Some Name"
MouseClick("left",$x,$y) ; x and y being the textbox
send($name)

And, no, controlsend WILL NOT WORK.

And, no, controlsend WILL NOT WORK.

And, no, controlsend WILL NOT WORK.

And, no, controlsend WILL NOT WORK.

</rant>

Best of luck

-Monkeh

ok i got that but if i use that i need to put my shopname info in the script ryt ??

but what i need is to set in variable then it will read like this....

what if i want a name of shopname1???

then if want i want shopname2???

get my point sir??

its depends on bot user to choose her/his shopname......

if i put $name = "shopname1"

always shopname1 will send ryt?? so i cant choose my shopname on my own??ryt?.

Have you seen the AutoIt v3 Window tool? If you can get the infomation of whats in the window, then usually you can control send it. Post a picture of the Au3 Window Control tab, and we should be able to do a short test, of just sending the text to the window. Then we can work out the rest. So in other words, we're going from scratch smile.gif

i go try it i will post here what will be result

EDITED:i think its not useful muttley

Edited by jerwin

[font="Arial Black"]Looking for a partner in making Perfect Bot for DEKARONPm me if you wanna join.....[/font]

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