User Tools

Site Tools


user:bewanyk:portfolio:autodraw

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
user:bewanyk:portfolio:autodraw [2011/05/20 04:32] – 2/3 AutoDraw. bewanykuser:bewanyk:portfolio:autodraw [2011/05/20 18:34] (current) bewanyk
Line 1: Line 1:
 +======Auto Draw with XPaint!======
 +=====Requirements=====
 +Begin with a PC or terminal with a unix/linux operating system, xpaint, xwit, and xte packets installed.
 +
 +Open a terminal session and begin by reading and experimenting with xte and xwit commands.  Once you are familliar with some of the possibilities provided by xte and xwit open a terminal window and begin editing a file for construction of your auto draw project.
 +
 +=====Beginning=====
 +Use the xwit commands to move the mouse and issue mouse click commands.
 +
 +Begin with mouse movement using xwit.  The location of the mouse destination is read from a 0, 0 origin located at the top left corner of the screen.  to move the mouse pointer to that 0, 0 point use the command:
 +<cli>:~$xwit -warp 0 0 -root</cli>
 +
 +Performing mouse clicks is easily accomplished using xte commands.  The mouse buttons are numbered starting with one on the left, two for the middle button, and three as a right click.  Therefore to issue a mouseclick you would use the command:
 +<cli>:~$xte 'mouseclick 1'</cli>
 +
 +To click and hold, as if for a click and drag function use the mousedown # command to press the button and teh mouseup # command to release it.
 +<cli>:~$xte 'mousedown 1'
 +:~$xte 'mousemove 100 100'
 +:~$xte 'mouseup 1'</cli>
 +
 +Using and investigation and the man pages fro xwit and xte eventually you can develop a script to move the mouse around the screen and perform actions without touching the computer itself.  
 +
 +<cli>#!/bin/bash
 +echo "Move mouse pointer to top left corner (0,0)..."
 +xwit -warp 0 0 -root
 +echo -n "Pause 5 seconds."
 +xte 'sleep 5'
 +echo "Move mouse pointer to bottom right corner (1280,1024)..."
 +xwit -warp 1280 1024 -root
 +echo "pause 3 seconds..."
 +xte 'sleep 3'
 +echo "Move mouse pointer to middle of screen (640, 512)..."
 +xwit -warp 640 512 -root
 +xte 'mousemove 320 768'
 +echo "open a lab46 window."
 +xte 'mouseclick 3'
 +xte 'key Down'
 +xte 'key Return'
 +</cli>
 +
 +=====Progression=====
 +Once you have experience to this point, now you can use wininfo to make the script more dynamic.
 +
 +The wininfo command will display information on the display you're using.  By examining the output from this command you can then use grep and sed commands to extract only the size of the display in use.
 +<cli>xTot=`xwininfo -root|grep Width|sed 's/^.*: //'`
 +yTot=`xwininfo -root|grep Height|sed 's/^.*: //'`</cli>
 +
 +These derived numbers can then be utilized with the xwit -resize option to gage the size of windows on the display.  Making any scripts you produce using them more dynamic and impressive.
 +
 +Using these commands and normal commmand execution you can soon begin to draw things in X-Paint.
 +use xwit -warp commands to find buttons on the canvas and pallet for xpaint.  Set variables to send you directly to those locations, and eventually your script will evolve into something like this...
 +
 +There can be squares inside squares with a script like this:
 +<cli>#!/bin/bash
 +winID=""
 +let lat=hei=0
 +xwit -warp 0 0 -root
 +tot=`xwit -all -print|grep Untitled|wc -l`
 +if [ tot > 0 ]; then
 +count=1
 +for ((count; count <= tot; count++)); do
 +winID=`xwit -all -print|grep 'Untitled'|head -1|sed 's/:.*$//'`
 +if [ -z $winID ]; then
 +echo -n
 +else
 +xwit -id $winID -name Rnd$count
 +winID=""
 +fi
 +done
 +fi
 +xTot=`xwininfo -root|grep Width|sed 's/^.*: //'`
 +yTot=`xwininfo -root|grep Height|sed 's/^.*: //'`
 +#echo $xTot
 +#echo $yTot
 +xpaint -nowarn &
 +xte 'sleep 5'
 +palt=`xwit -all -print|grep XPaint|sed 's/:.*$//'`
 +xwit -id $palt -move 0 0
 +let latP=`xwit -id $palt -print|sed 's/^.*w=//'|sed 's/ h=.*$//'`
 +let canX=$xTot-$latP
 +let canY=$yTot
 +menuP="xwit -warp 18 36 -root"
 +menuDwnP="xwit -rwarp 0 20 -root"
 +OrigP="xwit -warp 25 76 -root"
 +btnDwnP="xwit -rwarp 0 40 -root"
 +btnUpP="xwit -rwarp 0 -40 -root"
 +btnRtP="xwit -rwarp 40 0 -root"
 +btnLtP="xwit -rwarp -40 0 -root"
 +$menuP
 +xte 'mouseclick 1'
 +$menuDwnP
 +$menuDwnP
 +xte 'mouseclick 1'
 +xte 'sleep 2'
 +xte 'key BackSpace'
 +xte 'key BackSpace'
 +xte 'key BackSpace'
 +xte "str $canX"
 +xte 'key Tab'
 +xte 'key BackSpace'
 +xte 'key BackSpace'
 +xte 'key BackSpace'
 +xte "str $canY"
 +xte 'sleep 3'
 +xte 'key Return'
 +xte 'key Return'
 +xte 'sleep 3'
 +canID=`xwit -all -print|grep 'Untitled'|sed 's/:.*$//'`
 +#echo $canID
 +if [ -z $canID ]; then
 +echo -n
 +else
 +xwit -id $canID -name Pic
 +fi
 +let latC=`xwit -id $canID -print|sed 's/^.*w=//'|sed 's/ h=.*$//'`
 +let heiC=`xwit -id $canID -print|sed 's/^.*h=//'|sed 's/ d=.*$//'`
 +xwit -id $canID -move $latP 0
 +editB="xwit -warp 175 36 -root"
 +origN="xwit -warp $(($latP+8)) $(($heiC+13)) -root"
 +$OrigP
 +$btnDwnP
 +$btnDwnP
 +$btnDwnP
 +$btnDwnP
 +$btnRtP
 +xte 'mouseclick 1'
 +$origN
 +xwit -rwarp 200 -200 -root
 +xte 'mousedown 1'
 +xte 'sleep 1'
 +xte 'mousermove 200 -200'
 +xte 'sleep 1'
 +xte 'mouseup 1'
 +xte 'sleep 1'
 +xwit -warp 265 56 -root
 +xte 'mouseclick 1'
 +xte 'sleep 1'
 +$origN
 +xwit -rwarp 250 -250 -root
 +xte 'mousedown 1'
 +xte 'mousermove 100 -100'
 +xte 'mouseup 1'
 +xte 'sleep 1'
 +echo "Dun."</cli>
 +
 +Eventually with work it will progress till you can create multiple constructions. Squares, Circles, Fill actions and more!
 +<cli>#!/bin/bash
 +winID=""
 +let lat=hei=0
 +xwit -warp 0 0 -root
 +tot=`xwit -all -print|grep Untitled|wc -l`
 +if [ tot > 0 ]; then
 +count=1
 +for ((count; count <= tot; count++)); do
 +winID=`xwit -all -print|grep 'Untitled'|head -1|sed 's/:.*$//'`
 +if [ -z $winID ]; then
 +echo -n
 +else
 +xwit -id $winID -name Rnd$count
 +winID=""
 +fi
 +done
 +fi
 +xTot=`xwininfo -root|grep Width|sed 's/^.*: //'`
 +yTot=`xwininfo -root|grep Height|sed 's/^.*: //'`
 +#echo $xTot
 +#echo $yTot
 +xpaint -nowarn &
 +xte 'sleep 5'
 +palt=`xwit -all -print|grep XPaint|sed 's/:.*$//'`
 +xwit -id $palt -move 0 0
 +let latP=`xwit -id $palt -print|sed 's/^.*w=//'|sed 's/ h=.*$//'`
 +let canX=$xTot-$latP
 +let canY=$yTot
 +menuP="xwit -warp 18 36 -root"
 +menuDwn="xwit -rwarp 0 20 -root"
 +origP="xwit -warp 25 76 -root"
 +btnDwnP="xwit -rwarp 0 38 -root"
 +btnUpP="xwit -rwarp 0 -38 -root"
 +btnRtP="xwit -rwarp 38 0 -root"
 +btnLtP="xwit -rwarp -38 0 -root"
 +$menuP
 +xte 'mouseclick 1'
 +$menuDwn
 +$menuDwn
 +xte 'mouseclick 1'
 +xte 'sleep 2'
 +xte 'key BackSpace'
 +xte 'key BackSpace'
 +xte 'key BackSpace'
 +xte "str $canX"
 +xte 'key Tab'
 +xte 'key BackSpace'
 +xte 'key BackSpace'
 +xte 'key BackSpace'
 +xte "str $canY"
 +xte 'sleep 3'
 +xte 'key Return'
 +xte 'key Return'
 +xte 'sleep 3'
 +canID=`xwit -all -print|grep 'Untitled'|sed 's/:.*$//'`
 +#echo $canID
 +if [ -z $canID ]; then
 +echo -n
 +else
 +xwit -id $canID -name Pic
 +fi
 +let latC=`xwit -id $canID -print|sed 's/^.*w=//'|sed 's/ h=.*$//'`
 +let heiC=`xwit -id $canID -print|sed 's/^.*h=//'|sed 's/ d=.*$//'`
 +xwit -id $canID -move $latP 0
 +editB="xwit -warp 175 36 -root"
 +origN="xwit -warp $(($latP+8)) $(($heiC+13)) -root"
 +#get filled square
 +$origP
 +$btnDwnP
 +$btnDwnP
 +$btnDwnP
 +$btnDwnP
 +$btnRtP
 +xte 'mouseclick 1'
 +$origN
 +xwit -rwarp 200 -200 -root
 +xte 'mousedown 1'
 +xte 'sleep 1'
 +xte 'mousermove 200 -200'
 +xte 'sleep 1'
 +xte 'mouseup 1'
 +xte 'sleep 1'
 +xwit -warp 265 56 -root
 +xte 'mouseclick 1'
 +xte 'sleep 1'
 +$origN
 +xwit -rwarp 250 -250 -root
 +xte 'mousedown 1'
 +xte 'mousermove 100 -100'
 +xte 'mouseup 1'
 +xte 'mousermove 100 -100'
 +xte 'mouseup 1'
 +xte 'sleep 20'
 +#clear canvas
 +$editB
 +xte 'mouseclick 1'
 +for ((count=0; count<11; count++)); do
 +$menuDwn
 +done
 +xte 'mouseclick 1'
 +xte 'sleep 1'
 +let xCntr=$xTot/2
 +let yCntr=$yTot/2
 +xwit -warp 232 60 -root
 +xte 'mouseclick 1'
 +xte 'sleep 1'
 +#get empty circle
 +$origP
 +xte 'sleep 1'
 +$btnDwnP
 +$btnDwnP
 +$btnDwnP
 +$btnDwnP
 +$btnDwnP
 +xte 'sleep 1'
 +xte 'mouseclick 1'
 +xte 'sleep 1'
 +xwit -warp $(($xCntr-250)) $(($yCntr+250)) -root
 +xte 'mousedown 1'
 +xte 'mousermove 500 -500'
 +xte 'mouseup 1'
 +xte 'sleep 1'
 +$origP
 +for ((count=0; count<9; count++)); do
 +$btnDwnP
 +done
 +xte 'mouseclick 1'
 +xte 'sleep 1'
 +#set green
 +xwit -warp 352 58 -root
 +xte 'mouseclick 1'
 +xwit -warp $xCntr $yCntr -root
 +xte 'mouseclick 1'</cli>
 +
 +=====The final Step=====
 +With work and experimentation, eventually you can utilize the -rwarp option in xwit and the mousermove in xte to do relative moves.  finally you can produce scenes and pictures based on geometric extrapolation.  The scripts will get a bit long, but the results can be impressive.
 +
 +<cli>#!/bin/bash
 +winID=""
 +let lat=hei=0
 +xwit -warp 0 0 -root
 +tot=`xwit -all -print|grep Untitled|wc -l`
 +if [ $tot > 0 ]; then
 +count=1
 +for ((count; count <= tot; count++)); do
 +winID=`xwit -all -print|grep 'Untitled'|head -1|sed 's/:.*$//'`
 +if [ -z $winID ]; then
 +echo -n
 +else
 +xwit -id $winID -name Rnd$count
 +winID=""
 +fi
 +done
 +fi
 +xTot=`xwininfo -root|grep Width|sed 's/^.*: //'`
 +yTot=`xwininfo -root|grep Height|sed 's/^.*: //'`
 +let xCntr=$xTot/2
 +let yCntr=$yTot/2
 +xpaint -nowarn &
 +xte 'sleep 7'
 +menuP="xwit -warp 18 36 -root"
 +menuDwn="xwit -rwarp 0 20 -root"
 +origP="xwit -warp 25 76 -root"
 +btnDwnP="xwit -rwarp 0 37 -root"
 +btnUpP="xwit -rwarp 0 -37 -root"
 +btnRtP="xwit -rwarp 38 0 -root"
 +btnLtP="xwit -rwarp -38 0 -root"
 +palt=`xwit -print -all|grep XPaint|sed 's/:.*$//'`
 +xwit -id $palt -move 0 0
 +let latP=`xwit -print -id $palt|sed 's/^.*w=//'|sed 's/ h=.*$//'`
 +let canX=$xTot-$latP
 +let canY=$yTot
 +#open canvas to screen - pallette.
 +$menuP
 +xte 'mouseclick 1'
 +$menuDwn
 +$menuDwn
 +xte 'mouseclick 1'
 +xte 'sleep 3'
 +xte 'key BackSpace'
 +xte 'key BackSpace'
 +xte 'key BackSpace'
 +xte "str $canX"
 +xte 'key Tab'
 +xte 'key BackSpace'
 +xte 'key BackSpace'
 +xte 'key BackSpace'
 +xte "str $canY"
 +xte 'sleep 3'
 +xte 'key Return'
 +xte 'key Return'
 +xte 'sleep 3'
 +canID=`xwit -all -print|grep 'Untitled'|sed 's/:.*$//'`
 +if [ -z $canID ]; then
 +echo -n
 +else
 +xwit -id $canID -name Scene
 +fi
 +let latC=`xwit -print -id $canID|sed 's/^.*w=//'|sed 's/ h=.*$//'`
 +let heiC=`xwit -print -id $canID|sed 's/^.*h=//'|sed 's/ d=.*$//'`
 +xwit -id $canID -move $(($latP+3)) 0
 +editB="xwit -warp 178 36 -root"
 +origN="xwit -warp $(($latP+7)) $(($heiC)) -root"
 +lineB="xwit -warp 217 36 -root"
 +red="xwit -warp 271 56 -root"
 +black="xwit -warp 238 60 -root"
 +green="xwit -warp 358 58 -root"
 +blue="xwit -warp 421 60 -root"
 +ltBlu="xwit -warp 420 69 -root"
 +yellow="xwit -warp 348 70 -root"
 +white="xwit -warp 178 70 -root"
 +orange="xwit -warp 491 70 -root"
 +grey="xwit -warp 200 60 -root"
 +line="xwit -warp 217 36 -root"
 +if [ $canX > $canY ]; then
 +        let SEG=$canY/30
 +else let SEG=$canX/40
 +fi
 +$black
 +xte 'mouseclick 1'
 +$origP
 +for ((count=0; count < 7; count++)); do
 +$btnDwnP
 +done
 +xte 'mouseclick 1'
 +$line
 +xte 'mouseclick 1'
 +$menuDwn
 +$menuDwn
 +$menuDwn
 +xte 'mouseclick 1'
 +$black
 +xte 'mouseclick 1'
 +$origN
 +xwit -rwarp 20 -20 -root
 +xwit -rwarp $(($SEG*9)) 0 -root
 +#outside frame.
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*-9)) $(($SEG*-6))"
 +xte 'mouseclick 1'
 +xte "mousermove 0 $(($SEG*-12))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*9)) $(($SEG*-3))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*9)) $(($SEG*3))"
 +xte 'mouseclick 1'
 +xte "mousermove 0 $(($SEG*12))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +$origP
 +$btnDwnP
 +$btnDwnP
 +$btnRtP
 +xte 'mouseclick 1'
 +$origN
 +xwit -rwarp 20 -20 -root
 +xwit -rwarp $(($SEG*9)) 0 -root
 +#outer front edge
 +xte 'mouseclick 1'
 +xte "mousermove 0 $(($SEG*-12))"
 +xte 'sleep 2'
 +xte 'mouseclick 1'
 +xte 'sleep 2'
 +xte "mousermove $(($SEG*-9)) $(($SEG*-6))"
 +xte 'sleep 2'
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte "mousermove $(($SEG*18)) 0"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*-9)) $(($SEG*6))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +#individual cubes.
 +xte "mousermove $(($SEG*-3)) $(($SEG*10))"
 +xte 'mouseclick 1'
 +xte "mousermove 0 $(($SEG*-12))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*9)) $(($SEG*-5))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte "mousermove $(($SEG*-3)) $(($SEG*-1))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*-9)) $(($SEG*4))"
 +xte 'mouseclick 1'
 +xte "mousermove 0 $(($SEG*12))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte "mousermove $(($SEG*-3)) $(($SEG*-6))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*9)) $(($SEG*6))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*9)) $(($SEG*-6))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte "mousermove 0 $(($SEG*-4))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*-9)) $(($SEG*6))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*-9)) $(($SEG*-6))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte "mousermove $(($SEG*3)) $(($SEG*-5))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*9)) $(($SEG*5))"
 +xte 'mouseclick 1'
 +xte "mousermove 0 $(($SEG*12))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte "mousermove $(($SEG*3)) $(($SEG*-2))"
 +xte 'mouseclick 1'
 +xte "mousermove 0 $(($SEG*-12))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*-9)) $(($SEG*-4))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +#change color to begin fill
 +$green
 +xte 'mouseclick 1'
 +xte 'sleep 3'
 +#set fill tool.
 +$origP
 +for ((count=0; count<9; count++)); do
 +$btnDwnP
 +done
 +xte 'mouseclick 1'
 +xte 'sleep 3'
 +#fill blocks.
 +$origN
 +xwit -rwarp 20 20 -root
 +xte "mousermove $(($SEG*1)) $(($SEG*-8))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*6)) 0"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*6)) $(($SEG*-1))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*-9)) $(($SEG*-5))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*5)) $(($SEG*-7))"
 +xte 'mouseclick 1'
 +xte 'sleep 3'
 +$red
 +xte 'mouseclick 1'
 +xte 'sleep 3'
 +$origN
 +xwit -rwarp 20 20 -root
 +xte "mousermove $(($SEG*4)) $(($SEG*-10))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*6)) $(($SEG*3))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*3)) $(($SEG*2))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*-4)) $(($SEG*-9))"
 +xte 'mouseclick 1'
 +xte 'sleep 2'
 +xte "mousermove $(($SEG*3)) $(($SEG*-6))"
 +xte 'mouseclick 1'
 +xte 'sleep 3'
 +$blue
 +xte 'mouseclick 1'
 +xte 'sleep 3'
 +$origN
 +xwit -rwarp 20 20 -root
 +xte "mousermove $(($SEG*3)) $(($SEG*-18))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*9)) $(($SEG*1))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*-5)) $(($SEG*5))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*9)) $(($SEG*4))"
 +xte 'mouseclick 1'
 +$yellow
 +xte 'mouseclick 1'
 +xte 'sleep 3'
 +$origN
 +xwit -rwarp 20 20 -root
 +xte "mousermove $(($SEG*4)) $(($SEG*-6))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*-3)) $(($SEG*-10))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*8)) $(($SEG*-2))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*7)) $(($SEG*2))"
 +xte 'mouseclick 1'
 +$orange
 +xte 'mouseclick 1'
 +xte 'sleep 3'
 +$origN
 +xwit -rwarp 20 20 -root
 +xte "mousermove $(($SEG*1)) $(($SEG*-12))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*6)) $(($SEG*8))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*6)) $(($SEG*-11))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG*2)) $(($SEG*-4))"
 +xte 'mouseclick 1'
 +#Image2
 +if [ $canX > $canY ]; then
 +        let SEG2=$canY/130
 +else let SEG2=$canX/250
 +fi
 +origN2="xwit -warp $(($latP+$canX/2+60)) $(($heiC-$SEG2*30)) -root"
 +$black
 +xte 'mouseclick 1'
 +xte 'sleep 3'
 +$line
 +xte 'mouseclick 1'
 +$menuDwn
 +$menuDwn
 +$menuDwn
 +xte 'mouseclick 1'
 +$origP
 +for (( count=0; count < 7; count++)); do
 +$btnDwnP
 +done
 +xte 'sleep 3'
 +xte 'mouseclick 1'
 +xte 'sleep 1'
 +$origN2
 +xte "mousermove $(($SEG2*40)) $(($SEG2*-3))"
 +xte 'mouseclick 1'
 +xte "mousermove 0 $(($SEG2*-38))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-13)) $(($SEG2*27))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*13)) $(($SEG2*-27))"
 +xte 'mouseclick 1'
 +xte "mousermove 0 $(($SEG2*19))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte 'mouseclick 1'
 +xte "mousermove 0 $(($SEG2*-19))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*24)) $(($SEG2*3))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*10)) $(($SEG2*-7))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*2)) $(($SEG2*-22))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-12)) $(($SEG2*-9))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-10)) $(($SEG2*6))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte 'mouseclick 1'
 +xte "mousermove 0 $(($SEG2*-24))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*10)) $(($SEG2*18))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte "mousermove $(($SEG2*-10)) $(($SEG2*-18))"
 +xte 'mouseclick 1'
 +xte "mousermove 0 $(($SEG2*24))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-12)) $(($SEG2*-22))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +$origN2
 +xte "mousermove $(($SEG2*40)) $(($SEG2*-3))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-13)) $(($SEG2*-12))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-20)) $(($SEG2*-5))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*13)) $(($SEG2*12))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte "mousermove $(($SEG2*-13)) $(($SEG2*-12))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*20)) $(($SEG2*5))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*13)) $(($SEG2*-26))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-21)) $(($SEG2*-3))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-17)) $(($SEG2*-4))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*12)) $(($SEG2*15))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte "mousermove $(($SEG2*-12)) $(($SEG2*-15))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*17)) $(($SEG2*4))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*13)) $(($SEG2*-29))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-17)) $(($SEG2*-3))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*17)) $(($SEG2*3))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-3)) $(($SEG2*-5))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte "mousermove $(($SEG2*3)) $(($SEG2*5))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*21)) $(($SEG2*3))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-13)) $(($SEG2*28))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-8)) $(($SEG2*-11))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-13)) $(($SEG2*9))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte "mousermove $(($SEG2*13)) $(($SEG2*-9))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*13)) $(($SEG2*2))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte "mousermove $(($SEG2*-13)) $(($SEG2*-21))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-9)) $(($SEG2*-21))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*19)) $(($SEG2*1))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*12)) $(($SEG2*-2))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-19)) $(($SEG2*-1))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +$origN2
 +xte "mousermove $(($SEG2*40)) $(($SEG2*-3))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*29)) $(($SEG2*-3))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*1)) $(($SEG2*-21))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-30)) $(($SEG2*5))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +xte "mousermove $(($SEG2*30)) $(($SEG2*-5))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-9)) $(($SEG2*-9))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-8)) $(($SEG2*6))"
 +xte 'mouseclick 1'
 +xte 'mouseclick 2'
 +$origP
 +for (( count=0; count<9; count++ )); do
 +$btnDwnP
 +done
 +xte 'mouseclick 1'
 +$ltBlu
 +xte 'mouseclick 1'
 +$origN2
 +xte "mousermove $(($SEG2*35)) $(($SEG2*-5))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*3)) $(($SEG2*-25))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*5)) $(($SEG2*-2))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*10)) $(($SEG2*-15))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*10)) $(($SEG2*-20))"
 +xte 'mouseclick 1'
 +xte "mousermove 0 $(($SEG2*-5))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-5)) $(($SEG2*-5))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-20)) 0"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-12)) $(($SEG2*2))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-3)) $(($SEG2*10))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*-10)) $(($SEG2*23))"
 +xte 'mouseclick 1'
 +$origN2
 +xte "mousermove $(($SEG2*50)) $(($SEG2*-8))"
 +xte 'mouseclick 1'
 +xte "mousermove $(($SEG2*10)) $(($SEG2*-25))"
 +xte 'mouseclick 1'
 +$grey
 +xte 'mouseclick 1'
 +$origN2
 +xte 'mouseclick 1'
 +$origN</cli>
 +