Sign in to follow this  
Followers 0
7h331337

such a noobie quwestion

13 posts in this topic

if i have this in a ini

[ty]

hi=hillo

and i get this to retrev it

$var = hi

IniRead("my brain.ini", "ty", $var, "????")

this should work but isnt

can any 1 tel me y

Share this post


Link to post
Share on other sites



See if this works!

IniWrite(@ScriptDir&"\my brain.ini", "ty", "hi", "hillo"

Local $HiVariable = "hi"

$ReadIni = IniRead(@ScriptDir&"\my brain.ini", "ty", $HiVariable, "????")

MsgBox(0, "$ReadIni Return:", "$ReadIni Returns: "& $ReadIni)

Share this post


Link to post
Share on other sites

See if this works!

IniWrite(@ScriptDir&"\my brain.ini", "ty", "hi", "hillo"

Local $HiVariable = "hi"

$ReadIni = IniRead(@ScriptDir&"\my brain.ini", "ty", $HiVariable, "????")

MsgBox(0, "$ReadIni Return:", "$ReadIni Returns: "& $ReadIni)
i just figured out y my ini was in rong place lol thanks any way for ure help

Share this post


Link to post
Share on other sites

You want to read the ini into a variable, so

$var = IniRead()

That way, your $var will be whatever it picked up from you INI file.

because by just doing this:

$var = "hi"

you are already defining $var as 'hi"

and you are doing nothing with

IniRead("my brain.ini", "ty", $var, "????")

^all you are doing there is reading the file, but not doing anythign with it

$var = IniRead("my brain.ini", "ty","hi", "????")

although, if you DID mean to use $var as your section, you still need to read it to a variable

$var = hi
$var2 = IniRead("my brain.ini", "ty", $var, "????")

[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]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

ok here is my script

CODE

#include <GUIConstants.au3>

#include <EditConstants.au3>

$Form1 = GUICreate("Form1", 325, 343, 269, 155)

$a = GUICtrlCreateEdit("", 16, 16, 289, 233)

$b = GUICtrlCreateEdit("", 16, 256, 201, 73)

$Button1 = GUICtrlCreateButton("Button1", 232, 264, 73, 65, 0)

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

If $nMsg = $GUI_EVENT_CLOSE Then

Exit

EndIf

$msnb = ControlSetText("7H3 - ", "", "RichEdit20W2", GUICtrlRead($:P)

If $nMsg = $Button1 Then

ControlSetText("7H3 -", "", "RichEdit20W1", "")

ControlClick("7H3 - ", "", "Button1")

GUICtrlSetData($b, "")

sleep(7000)

$msn = ControlGetText("7H3 - ", "", "RichEdit20W1")

GUICtrlSetData($a, $msn)

$string = StringSplit($msn, @CRLF)

sleep(500)

If $string[0] >= 9 Then

tooltip($string[9])

$ini = IniRead(@scriptdir & "/my brain.ini", "tv", $string[9], "????")

$msnb = ControlSetText("7H3 - ", "", "RichEdit20W2", $ini)

GUICtrlSetData($b, $ini)

ControlClick("7H3 - ", "", "Button1")

GUICtrlSetData($b, "")

EndIf

EndIf

WEnd

here is what is in the ini

CODE

[tv]

hi=hillo

can any one tell me wy its not working i jost get ???? bk wen i try

Edited by 7h331337

Share this post


Link to post
Share on other sites

#include <GUIConstants.au3>

#include <EditConstants.au3>

$Form1 = GUICreate("Form1", 325, 343, 269, 155)

$a = GUICtrlCreateEdit("", 16, 16, 289, 233)

$b = GUICtrlCreateEdit("", 16, 256, 201, 73)

$Button1 = GUICtrlCreateButton("Button1", 232, 264, 73, 65, 0)

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

If $nMsg = $GUI_EVENT_CLOSE Then

Exit

EndIf

$msnb = ControlSetText("7H3 - ", "", "RichEdit20W2", GUICtrlRead($:P)

If $nMsg = $Button1 Then

ControlSetText("7H3 -", "", "RichEdit20W1", "")

ControlClick("7H3 - ", "", "Button1")

GUICtrlSetData($b, "")

sleep(7000)

$msn = ControlGetText("7H3 - ", "", "RichEdit20W1")

GUICtrlSetData($a, $msn)

$string = StringSplit($msn, @CRLF)

sleep(500)

If $string[0] >= 9 Then

tooltip($string[9])

$ini = IniRead(@scriptdir & "/my brain.ini", "tv", $string[9], "????")

$msnb = ControlSetText("7H3 - ", "", "RichEdit20W2", $ini)

GUICtrlSetData($b, $ini)

ControlClick("7H3 - ", "", "Button1")

GUICtrlSetData($b, "")

EndIf

EndIf

WEnd

Wrong slash!

Share this post


Link to post
Share on other sites

i changed the / to \ still not working

Share this post


Link to post
Share on other sites

i changed the / to \ still not working

can you pls tell whats not working

its not reading ini secrot, its not setting data, its not reading data?

:P


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

Did some more testing, and it's because when you have your script, when you click the button, it clears the text from that box, and later reads it, and if its greater than or equal to 9 then it writes, but since the box is cleared, it is 0 so it writes nothing!

Share this post


Link to post
Share on other sites

i changed it to

CODE

#include <GUIConstants.au3>

#include <EditConstants.au3>

$Form1 = GUICreate("Form1", 325, 343, 269, 155)

$a = GUICtrlCreateEdit("", 16, 16, 289, 233)

$b = GUICtrlCreateEdit("", 16, 256, 201, 73)

$Button1 = GUICtrlCreateButton("Button1", 232, 264, 73, 65, 0)

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

If $nMsg = $GUI_EVENT_CLOSE Then

Exit

EndIf

$msnb = ControlSetText("7H3 - ", "", "RichEdit20W2", GUICtrlRead($:P)

If $nMsg = $Button1 Then

ControlClick("7H3 - ", "", "Button1")

GUICtrlSetData($b, "")

sleep(7000)

$msn = ControlGetText("7H3 - ", "", "RichEdit20W1")

GUICtrlSetData($a, $msn)

$string = StringSplit($msn, @CRLF)

ControlSetText("7H3 -", "", "RichEdit20W1", "")

sleep(500)

If $string[0] >= 9 Then

tooltip($string[9])

$ini = IniRead(@scriptdir & "\my brain.ini", "tv", $string[9], "????")

$msnb = ControlSetText("7H3 - ", "", "RichEdit20W2", $ini)

GUICtrlSetData($b, $ini)

ControlClick("7H3 - ", "", "Button1")

GUICtrlSetData($b, "")

EndIf

EndIf

WEnd

still wont work by the way its for msn

Share this post


Link to post
Share on other sites

i figured it out u wont believe how stupid it was

in named my ini mybrain.ini but on the script i called it my brain.ini

big thanks to all that helped

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

try removing the space between my and brain, mayby use an underscore my_brain.ini

I've experienced problems with space before, and it's the only thing I can think of at this point

set up "check points" by placing tooltipsor msgboxes here and there to see where the script starts to fail, perhaps it is MSN that is the problem?

EDIt: damn, you beat me to your own answer, haha

Edited by VindicatorOmega

[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]

Share this post


Link to post
Share on other sites

try removing the space between my and brain, mayby use an underscore my_brain.ini

I've experienced problems with space before, and it's the only thing I can think of at this point

set up "check points" by placing tooltipsor msgboxes here and there to see where the script starts to fail, perhaps it is MSN that is the problem?

EDIt: damn, you beat me to your own answer, haha

lol Omega i never check the simple stuff i wish i did no lol i feel so dumb

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