Jump to content

A practical way of doing this?


Recommended Posts

Hi all,

I need help for the following, i have very basic knowledge of autoit commands and thats why im asking for help here, i dont want to create a gigantic file when maybe there are other more optimun ways of doing this.

Basically what i need to do is a paste and click/enter of a number which autoit should increment by 1 each time, the numbers go from 00 to FF (hexadecimal), so the idea is autoit makes the first number of the list (01) then it goes to a field and deletes the previous number and paste the new one, then click on ok button to store it (sometimes the enter key of this program does not actually stores it so i rather have it clicking).

How can i do this properly?

Thanks

Link to comment
Share on other sites

you could start by explaining yourself, because as it stands, your post is meaningless, it tells no-one anything (who is not a fibre optic psychic)

maybe you should make your "gigantic file" and you can get some help optimising it.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Wow why the aggression... anyhow..i don't really know how to make myself more clear, au makes an array of numbers 00 to FF and then copy pastes it to a field? i really tough this was the place to ask for help making these kind of things? and John please if is not for helping refrain from posting thanks :huh2:

Link to comment
Share on other sites

Wow why the aggression... anyhow..i don't really know how to make myself more clear, au makes an array of numbers 00 to FF and then copy pastes it to a field? i really tough this was the place to ask for help making these kind of things? and John please if is not for helping refrain from posting thanks :huh2:

Firstly, there is no aggression, and secondly, you do not get to say which threads I post in.

I stand by what I said.

you want to paste 00, ff into a field? or something like that! It just does not mean anything, and by the way, playing the poor done to noob card of "I thought this was the place to come for help" is a tired one.

Here's some advice, it will help you a whole lot if you can even put into words, what it is you want to do.

Best of luck.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Right because you are totally not posting aggressively and NOT calling me a noob.. ANYHOW "how to make autoit make an array of hexadecimal numbers and copy and paste it into a text field?" <--- how the hell is that hard to understand.. beats me.

You have been reported for spamming and trolling, now gtfo my thread already, you obviously have no intention to even read what im asking since the first post.

Link to comment
Share on other sites

As bad as I hate to agree with JohnOne... he's done nothing wrong. This isn't a charity website. If you want help, show some code you need help with. You're trying to take shortcuts by skipping the whole learning phase and trying to get to the "I have what I want phase". The veterans of the forum like JohnOne don't go in for that. We all started out writing those "gigantic" files when we didn't know what we were doing. It's called learning. I suggest you do some of it.

Link to comment
Share on other sites

hi Argentino,

Your original post was indeed quite ambiguous and seemed to lack initiative :huh2:

Remember, the more comprehensive your post is, the easier it is to help you :ph34r: and when you show that you've tried something, people are more inclined to help.

You needn't make an array, try using a for loop, together with the Hex() and ControlSetText() functions, search them up in the help file for usage info etc ;)

Hope this helps :alien:

-smartee

Link to comment
Share on other sites

@Valik: Thanks for the insight of things, however this is not needed at all, you don´t stop and reply to someone in the street asking you for directions "What a nib, go buy a map and learn your way..", there is no point, if no contribution can be made just move on and let the post die if it have to, "You're trying to take shortcuts" <-- How can you make an assumption like that?, just was asking a simple question i´m not asking anyone to come and give me the complete code.

@smartee: Thanks i will try that.

Link to comment
Share on other sites

Okey so far i managed to do the counter and the copy, im having problems with integrating a way to delete the previous text and paste each result? im working with a text field, all i need to do is paste $Result once, do a click on a button so the value gets logged, then delete that $Result that was logged and add the next one untill the end of the loop.

Here is the code so far:

HotKeySet("{ESC}", "Terminate")

$n= Hex(00, 4)

do

$Result = Hex($n, 4)

MsgBox(0, "Hexadecimal code "&$Result, $Result) ;This will be removed, is just to test.
$n +=1
ClipPut($Result)
ControlSetText("Wordpad", "", "Edit1", "New Text Here" ) ;How to put the result here?
Until $n= Hex(30, 4)

Func Terminate()
    Exit 0
EndFunc
Link to comment
Share on other sites

hi,

Use the AutoIt Window Info Tool to find out specific control and window information, there is more info about this tool in the help file.

Here's a quick example of using the ControlSetText() function:

Run(@ProgramFilesDir & "\Windows NT\Accessories\wordpad.exe")
WinWaitActive("Document - WordPad")
For $i = 1 To 255
    ControlSetText("Document - WordPad", "", "RICHEDIT50W1", Hex($i, 2))
Next

Try modifying it to suit your needs and if you run into a problem post back with the details :huh2:

Good luck,

-smartee

Link to comment
Share on other sites

Thanks smartee, i developed it to an "usable" state, i realised i sadly cant use the controlsettext efficiently, but control+V worked perfectly, however there are still issues, mostly is because the hexadecimal code is wrong, here is the code so far:

Fixed

This does as i wanted but is really inefficient and slow, now probably the pros here can polish it and make it a lot better, now to the major issue, as far as it goes 25856 should be 6500 in hexa, however is reported as 1900 something, dunno where the mistake is nor if this is an autoit bug?

Thanks

Edit:

Nevermind i seen where the mistake was, well the script is finished and this is the best i could do:

Removed, if someone is interested pm me
Edited by Argentino
Link to comment
Share on other sites

hi again, ;)

No bugs, try this

MsgBox(64, "Hex Demo", "Hex(25856,4)=" & Hex(25856, 4))

A number of things stand out:

You store a hex value in $n, then you increment it as an integer inside a do.. until loop, whose until condition is "ill conceived" to say the least. :huh2:

Try to resolve these issues and post back your progress :alien:

Also its difficult to help you optimize a bunch of clicks on your computer, because they can represent any number of application interactions, perhaps if you went "the safer route" using ControlSetText etc., we could have at least known what you were trying to do :ph34r:

-smartee

Link to comment
Share on other sites

Thanks so much for pointing those commands out Smartee, and true it ended up doing what it was supposed to do, slow but works so now i can go to sleep and save myself hours of work, im removing the script and if you need it for anything just pm me but i dont think u need that xD, the loop should end when the target hex code is reach, im implementing a save feature to save me even more work.

When is totally finish ill publish it here again, it was fairly easy guess those hours of neverending java paid off.

Link to comment
Share on other sites

@Valik: Thanks for the insight of things, however this is not needed at all, you don´t stop and reply to someone in the street asking you for directions "What a nib, go buy a map and learn your way..", there is no point, if no contribution can be made just move on and let the post die if it have to, "You're trying to take shortcuts" <-- How can you make an assumption like that?, just was asking a simple question i´m not asking anyone to come and give me the complete code.

You missed the point, your initial post does not explain anything regarding what you are trying to do.

"paste and click/enter of a number which autoit should increment by 1 each time"

paste and click what number in what application? a control? an image?, the rest of the post is the same. My point is, without a code snippet to look at, those words dont actually mean anything.

"you don´t stop and reply to someone in the street asking you for directions "What a nib, go buy a map and learn your way..""

In this situation, if the person asking for directions were yourself, then you did'nt give the essential information of where you would like directions to.

I hope you understand, because it will save everyone a lot of farting about in the future.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

First of all, you're an idiot. Let me demonstrate.

@Valik: Thanks for the insight of things, however this is not needed at all, you don´t stop and reply to someone in the street asking you for directions "What a nib, go buy a map and learn your way..", there is no point, if no contribution can be made just move on and let the post die if it have to,

You drew my attention to this thread. You apparently felt the need to report JohnOne and guess what, moderators see those reports (Imagine that!).

"You're trying to take shortcuts" <-- How can you make an assumption like that?,

It's not an assumption, you very nearly explicitly state it with the line:

i dont want to create a gigantic file when maybe there are other more optimun ways of doing this.

So yeah, shortcut.

just was asking a simple question i´m not asking anyone to come and give me the complete code.

You did not ask a simple question. You asked how to write an entire script "correctly". That is asking for code in most people's book since you didn't give the first line of code to work from as a base.

Anyway. I don't like your attitude. You're just another idiot who comes on our forum and asks for stuff and gets all entitled when they don't get what they want. We do not need you. You have a week to think about that before you can post again. This thread is locked, if you bring this subject up again you will be permanently removed. If you PM - at all - you will be permanently removed. Come back and act like you have some semblance of intelligence or don't bother coming back.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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