AutoHotkey Community

It is currently May 26th, 2012, 10:45 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Help with Script
PostPosted: August 11th, 2005, 2:42 pm 
I need help on this script.
Basically i want it so you type something in and the keystrokes are the same, but when it goes through the fileappend, the text document has the translated.

Code:
Inputbox,output,Digital Enigma,Enter Text to be translated, 50, 600
Fileappend, %output%, C:\test.txt

#UseHook
SetStoreCapslockMode Off
q::Send m
w::Send n
e::Send b
r::Send v
t::Send c
y::Send x
u::Send z
i::Send l
o::Send k
p::Send j
a::Send h
s::Send g
d::Send f
f::Send d
g::Send s
h::Send a
j::Send p
k::Send o
l::Send i
z::Send u
x::Send y
c::Send t
v::Send r
b::Send e
n::Send w
m::Send q
1::Send 0
2::Send 9
3::Send 8
4::Send 7
5::Send 6
6::Send 5
7::Send 4
8::Send 3
9::Send 2
0::Send 1
Exitapp


Basically what you type comes out correct,
but the saved file (fileappend) has the translated input.
If that makes any sense :roll:

Any help please :D

P.S I use the word 'translated' because i cant think of any other word :P


Report this post
Top
  
Reply with quote  
 Post subject: Sk Wahc'g cab jvkeibq?
PostPosted: August 11th, 2005, 3:41 pm 
Offline

Joined: January 25th, 2005, 9:08 pm
Posts: 31
Location: Netherlands
Sorry, your nifty AHK was still running.

So what's the problem? It works fine. Or do i understand you want the originally typed text in the textfile, rather than the translated text?

gr VP


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 11th, 2005, 4:11 pm 
Image
What you type into the input box is correct, as shown above.
P.S I had to edit the script to make it look like that.

This is a photo of what it looks like at the moment, because of the #UseHook command it doesnt present itself correct.
Image
This is the picture of what the #UseHook command changes 'this is a test' into.

What i am looking for is when you type into the inputbox, it is normal and nothing is done to it.

When it is saved (fileappend) it has the translated text.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 11th, 2005, 5:00 pm 
Offline

Joined: October 27th, 2004, 1:22 am
Posts: 64
Location: GA
you can do something like this:

Code:
Inputbox,output,Digital Enigma,Enter Text to be translated, 50, 600
Autotirm, off
Loop, Parse, output
{
var1:= A_loopfield
var2:= replace(var1)
write = %write%%var2%
}
Fileappend, %write%, C:\test.txt

;----------------------------------------------------------------------
;function
;----------------------------------------------------------------------

replace(ab)
{
If ab = q
return "m"
If ab = w
return "n"
If ab = e
return "b"
If ab = r
return "v"
If ab = t
return "c"
If ab = y
return "x"
If ab = u
return "z"
If ab = i
return "l"
If ab = o
return "k"
If ab = p
return "j"
If ab = a
return "h"
If ab = s
return "g"
If ab = d
return "f"
If ab = f
return "d"
If ab = g
return "s"
If ab = h
return "a"
If ab = j
return "p"
If ab = k
return "o"
If ab = l
return "i"
If ab = z
return "u"
If ab = x
return "y"
If ab = c
return "t"
If ab = v
return "r"
If ab = b
return "e"
If ab = n
return "w"
If ab = m
return "q"
If ab = 1
return 0
If ab = 2
return 9
If ab = 3
return 8
If ab = 4
return 7
If ab = 5
return 6
If ab = 6
return 5
If ab = 7
return 4
If ab = 8
return 3
If ab = 9
return 2
If ab = 0
return 1
else
return ab
}

_________________
-Tru 8)


Last edited by tpatel5 on August 11th, 2005, 6:17 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 11th, 2005, 5:45 pm 
Thank you!!!
Its exactly what i wanted.
I also made the decoder for it if anyone is interested in this :D

Code:
Inputbox,output,Digital Enigma,Enter Text to be translated, 50, 600
Autotrim, off
Loop, Parse, output
{
var1:= A_loopfield
var2:= replace(var1)
write = %write%%var2%
}
Fileappend, %write%, C:\test.txt

;----------------------------------------------------------------------
;function
;----------------------------------------------------------------------

replace(ab)
{
If ab = m
return "q"
If ab = n
return "w"
If ab = b
return "e"
If ab = v
return "r"
If ab = c 
return "t"
If ab = x 
return "y"
If ab = z
return "u"
If ab = l
return "i"
If ab = k
return "o"
If ab = j
return "p"
If ab = h
return "a"
If ab = g
return "s"
If ab = f
return "d"
If ab = d
return "f"
If ab = s
return "g"
If ab = a
return "h"
If ab = p
return "j"
If ab = o
return "k"
If ab = i
return "l"
If ab = u
return "z"
If ab = y
return "x"
If ab = t
return "c"
If ab = r
return "v"
If ab = e
return "b"
If ab = w
return "n"
If ab = q
return "m"
If ab = 1
return  0
If ab = 2
return  9
If ab = 3
return  8
If ab = 4
return  7
If ab = 5
return  6
If ab = 6
return  5
If ab = 7
return  4
If ab = 8
return  3
If ab = 9
return  2
If ab = 0
return  1
if ab = %A_space%
return A_space
if ab = %A_tab%
return A_tab
}


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 11th, 2005, 6:22 pm 
Offline

Joined: October 27th, 2004, 1:22 am
Posts: 64
Location: GA
Lol, I don't know if you realize this but you don't need any new script to decode , you can use the same sricpt to do both coding and decoding.


Quote:
if ab = %A_space%
return A_space
if ab = %A_tab%
return A_tab


I replaced this part of the function with

Code:
else
return ab


so anything beside those characters will remain same. For example, space, tab, ? $ & * . etc.

_________________
-Tru 8)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 12th, 2005, 4:15 pm 
You know i just relised that after i edited the whole script, but thanks anyway :D


Report this post
Top
  
Reply with quote  
 Post subject: xbox joxstick
PostPosted: August 13th, 2005, 5:19 am 
Offline

Joined: August 13th, 2005, 5:11 am
Posts: 1
i cant get the joystickmouse program to run
it says
{ error at line 152.
line text: (JoyPOV
error: this text contains an illegal character.

the program will exit}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 13th, 2005, 6:20 am 
Hey mister,
maybe I've lost you here, but ... how is that related to the initial subject?

Hm, I've to correct myself. Because the intial subject line is useless/unspecific it could be that you thought we collect all help requests within a single thread!!!

AFAIK that's not the case. Go and create your own thread.
One problem, one thread. It's that simple. Thx. 8)


Report this post
Top
  
Reply with quote  
 Post subject: Help
PostPosted: August 13th, 2005, 8:40 pm 
Hey i dont understand y my script dont work
Bassically im tryuing to get it 2 work for a program called winmx well here it is

#z:: Run WinMx
Sleep, 5000
MouseClickDrag, Left, 966, 137, 800, 185
Sleep, 1000
MouseClick, Left, 475, 100


I dont understand y the mouse dragging doesnt work
not sure y tho any suggestions


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 13th, 2005, 11:07 pm 
Offline

Joined: October 27th, 2004, 1:22 am
Posts: 64
Location: GA
I don't blame "mister" or "another guest" as the title for this topic is very broad. :)

@Mister

Please start a new topic in the Ask for Help secition, and include that part of your script or maybe just that particular line

@another guest

may be mouseclickdrag is too fast for your active window, use speed option with to slow it down
Quote:
MouseClickDrag, WhichButton, X1, Y1, X2, Y2 [, Speed, R]

_________________
-Tru 8)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: JSLover, Miguel, rbrtryn, XstatyK and 55 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group