AutoHotkey Community

It is currently May 26th, 2012, 3:16 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: March 7th, 2009, 2:34 am 
Not the best recognizer, since its only set up for my use in the first place ^^

But Try as you wish with my script..Modify it for letters!

It sends the Number you draw with LShift to the window
I use tablet..so ya, umm, Good Luck with it

More Said in script, but if you still have trouble, just ask I guess ^^

Code:
SetBatchLines -1
Space=6      ;Amount of space to decide next turning point, umm angles
Esc::ExitApp
End::Reload
;-----------------Author-----------------
; Fyrokid ^^
; I have a tablet, I play sudoku sometimes
; I dont usually share any of my scripts, theyre all mainly useless ^^
; -----------"What It Does"-----------
;  ..So Far.. Until you modify it...
; "Sends" the number you draw
; Open the notepad and draw in the notepad to test
;--------------Instuctions--------------
; Hold Left Shift and Draw a number with the mouse, more like a tablet Lol.. Mouse is not accurate enough.. Sorry -.-
;---------------My Limits---------------
; If you don't write like me, then it doesnt work, therefore modify this and make it work for you ^^
; I use 2 lines for my 4s -->  L|
;--------------Comments--------------
; I only wanted to make it so that when I play sudoku, I can just draw the number instead of using numpad
; Umm..For me, it works 80% of the time.. It's Just A Simple Script.. Modify for yourself
; Don't draw too small, Just about 50-80 pixels high, I guess that's good enough Info
; Atleast try it out, I know it needs more code, but since i have a tablet, it works great for me ^^
; I mean more code for more possibilities to recognize...
; You may ask me to do letters.. but I think you can make that yourself, and I dont know your handwriting
; If anything else, this is not really very useful
; Oh and batchlines may take up some usage, hope you dont mind
; I Hope That The Code Is Short and Simple Enough ^^
;--------------If Modified---------------
; Direction code is by Numbers ; Number code is in Numpad Direction format ^^ simple yes?
; Enable Tooltip and Find Patterns to misrecognize, That's all I say -.-

LShift & ~LButton::
If !GetKeyState("LShift")
   Return
MouseGetPos,x1,y1
cy:=y1, Dir:="", L:=""
While GetKeyState("LButton")
{
   MouseGetPos,x2,y2
   X:=x2-x1, Y:=y2-y1
   If(Abs(X)>Space && Abs(Y)>Space){
      If(X<-Space && Y>Space){
         If(L!=1 && L!=2 && L!=4)
            Dir.="1", L:=1
      }
      Else If(X>Space && Y>Space){
         If(L!=2 && L!=3 && L!=6)
            Dir.="3", L:=3
      }
      Else If(X<-Space && Y<-Space){
         If(L!=4 && L!=7 && L!=8)
            Dir.="7", L:=7
      }
      Else If(X>Space && Y<-Space){
         If(L!=6 && L!=8 && L!=9)
            Dir.="9", L:=9
      }
   }
   Else If(Abs(X)>Space || Abs(Y)>Space){
      If(Y>Space){
         If(L!=1 && L!=2 && L!=3)
            Dir.="2", L:=2
      }
      Else If(X<-Space){
         If(L!=1 && L!=4 && L!=7)
            Dir.="4", L:=4
      }
      Else If(X>Space){
         If(L!=3 && L!=6 && L!=9)
            Dir.="6", L:=6
      }
      Else If(Y<-Space){
         If(L!=7 && L!=8 && L!=9)
            Dir.="8", L:=8
      }
   }
   Else
      Continue
   x1:=x2, y1:=y2
}
dy:=y2
If(Dir==26 || Dir==16)
   Last=26
Else If(Abs(dy-cy)<10 && SubStr(Dir,-1,2)==84)
   Send 0
Else If(SubStr(Dir,-1,2)==26 || SubStr(Dir,-2,3)==246)
   Send 2
Else If(SubStr(Dir,1,1)==6 && SubStr(Dir,-1,2)==48)
   Send 3
Else If(SubStr(Dir,1,1)==6 && SubStr(Dir,-1,2)==24)
   Send 3
Else If(SubStr(Dir,1,2)==86 && SubStr(Dir,-1,2)==24)
   Send 3
Else If(SubStr(Dir,1,2)==92 && SubStr(Dir,0,1)==4)
   Send 3
Else If(Last==26 && Dir==2){
   Send 4
   Last:=4
}
Else If(Dir==2 || Dir==3 || Dir==1 || Dir==82)
   Send 1
Else If(SubStr(Dir,1,1)==4 && SubStr(Dir,-1,2)==48)
   Send 5
Else If(SubStr(Dir,1,1)==4 && SubStr(Dir,-1,2)==24)
   Send 5
Else If(Dir==434)
   Send 5
Else If(SubStr(Dir,-1,2)==42 || SubStr(Dir,-1,2)==84)
   Send 6
Else If(Dir==62 || Dir==61)
   Send 7
Else If(SubStr(Dir,-1,2)==86)
   Send 8
Else If(SubStr(Dir,-1,2)==82 || SubStr(Dir,-1,2)==62)
   Send 9
;Else
   ;ToolTip % "N " . Dir . "`n" . SubStr(Dir,1,1) . SubStr(Dir,0,1) . "`n" . Abs(dy-cy)
Return


Report this post
Top
  
Reply with quote  
 Post subject: Oh ya, Math
PostPosted: March 7th, 2009, 2:39 am 
Oh ya..
I also wanted to make it for this old script...

Code:
var=0
vr=0
wrong=0
time:=A_TickCount
sendmode input
loop
{
var+=1
if var=21
break

if vr=0
{
gosub,equation
vr+=1
}
gosub,equation

loop
{
inputbox,ans,Calculations,`n`n`n`n%p1%`n%a_tab%%a_tab% %p2% %a_tab% %p3%
if ErrorLevel
exitapp
if h=1
if(ans==f+g)
break
if h=2
if(ans==f-g)
break
if h=3
if(ans==f*g)
break
wrong+=1
}

}
time:=A_TickCount-time
stringtrimright,time,time,3
tyme=%time% seconds
if time<3600
gosub,time
if wrong=0
wrong=none
Msgbox,You got %wrong% wrong of 20.`nYou took %tyme% to solve 20 equations.
return




equation:
f:=a
g:=b
h:=c
loop
{
random,a,0,9
random,b,0,9
random,c,1,3
if c=1
d=+
if c=2
d=-
if c=3
d=X
if(a!=0
&& b!=0)
{
if(c=2
&& b>a)
{
   e:=a
   a:=b
   b:=a
}
break
}
}
p1:=p2
p2:=p3
p3=%a% %d% %b%
if var=20
p3=
return

time:
min=0
loop
{
if time>59
{
min+=1
time:=time-60
}
if time<60
break
}

if min>0
{
if time<10
tyme=%min%:0%time%
if time>9
tyme=%min%:%time%
}
if min=0
tyme=%time% seconds
return


Report this post
Top
  
Reply with quote  
 Post subject: Okay!!!
PostPosted: March 7th, 2009, 11:25 pm 
Offline

Joined: March 7th, 2009, 2:58 am
Posts: 1
So i made my Gf try it, and since shes from europe, umm..my code is not right for her! Lol!

But then Like it says in the script, if you want to use it, then modify it, the direction code is the same as the numpad direction keys, Find Patterns and make your own code ^^


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 15 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