AutoHotkey Community

It is currently May 27th, 2012, 10:09 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: July 13th, 2006, 10:38 am 
Offline

Joined: November 6th, 2005, 5:25 am
Posts: 182
The following will drop Cartillery on USMC artillery, as MEC on the Strike at Karkand map 90% of the time in x1 commander view in 1024x768 view (you don't have to zoom in).
Code:
;
; AutoHotkey      Version: 1.x
; Language:       English
; Platform:       Win9x/NT
;
; Press 7 on the Keypad to drop on the Left USMC artillery
; Press 9 on the Keypad to drop on the Right USMC artillery
;
; Only run this script when bf2.exe is running in the foreground
;
#SingleInstance force
#InstallKeybdHook


SetTimer, KeepRunning
return

KeepRunning:

  ; Get the process name of the active window (i.e. Notepad.exe)
  WinGet, szProcessName, ProcessName, A
  if szProcessName = bf2.exe
  {
    Suspend, off
  }
  else
  {
    Suspend, on
  }
return

;
; Disable the Window's keys so they don't switch to desktop while in-game
;
$LWin::   ; Left Windows Button
$RWin::   ; Right Windows Button
   ; Do nothing
return

$^CapsLock::
   ExitApp
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Pressing Ctrl+V while BF2 is active
$^v::
   Sleep 200
   SetKeyDelay, 30, 30
   Send,  {Space}%clipboard%
   SetKeyDelay, 0
return

MouseEvent(a_xpos, a_ypos)
{
   DllCall("mouse_event", uint,1, int,a_xpos, int,a_ypos, uint,0, int,0 )
}

DropCartillery(a_xPos,a_yPos,a_yMenuPos = 92, a_xMenuPos = 20)
{
   MouseEvent(-2000,-2000)
   sleep 100
   MouseEvent(a_xPos,a_yPos)
   sleep 20
   MouseClick, Right, , , , , D
   sleep 40
   MouseClick, Right, , , , , U
   MouseEvent(a_xMenuPos,a_yMenuPos)
   sleep 40
   MouseClick, Left, , , , , D
   sleep 40
   MouseClick, Left, , , , , U
   sleep 100
}

;
; Cartillery: USMC Left artillery - Karkand
;
$Numpad7::
$NumpadHome:
   DropCartillery(332,342,42)
return
;
; Cartillery: USMC Right artillery - Karkand
;
$Numpad9::
$NumpadPgUp:
   DropCartillery(379,328,58)
return


I tried dropping cartillery on MEC artillery with a HUMVEE, but literially the direction the artillery is facing will determine where to drop it (artillery is slanted towards its last target). Therefore its not reliable.

If curious, the x1 zoom for the MEC artillery is: (535, 175) and (568, 117). I tried creating a script that zooms in and then drops artillery to get better accuracy, but it doesn't matter because of the angle of the artillery. Vodiks just have a larger area...

EDIT: Added the DropCartillery and MouseEvent functions to make it easier to read and modify
EDIT: I updated the coordinates for the Right USMC artillery from 378x328 to 379x329
EDIT: I tested this script using 1280x1024 and I didn't have to change the coordinates

_________________
//TODO: Create kewl sig...


Last edited by Harmor on August 13th, 2006, 9:09 am, edited 4 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 12th, 2006, 6:55 pm 
You wouldn't happen to know what the coordinates are for 1280x1024 would you? :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 12th, 2006, 11:25 pm 
Try to find that out. Open up windowspy and then scroll to where those coordinates are then open upbf2 and keep mouse there.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 13th, 2006, 8:11 am 
Offline

Joined: November 6th, 2005, 5:25 am
Posts: 182
Lshink wrote:
You wouldn't happen to know what the coordinates are for 1280x1024 would you? :)


I tested this using 1280x1024 and I didn't have to change the coordinates. I updated the script to make it easier to read and modify.


Here are some other coordinates that I tested, but all failed except for Wake Island 2007 - USMC - Top Artillery: that one works like 30% of the time


; Sharqi Peninsula - USMC - Left Artillery: DropCartillery(461,244) ; [Failed @ x1 zoom: actual (461.5, 224) ]
; Sharqi Peninsula - USMC - Right Artillery: DropCartillery(473,253) ; [Failed @ x1 zoom: actual (473.3, 253) ]
; Wake Island - China - Top Artillery: DropCartillery(498,300,85) ; [Failed @ x1 zoom: actual (497.7, 300)]
; Wake Island - China - Middle Artillery: DropCartillery(502,298,85) ; [Failed @ x1 zoom: actual (501.7,298.5)]
; Wake Island - China - Bottom Artillery: DropCartillery(503,294) ; [Failed @ x1 zoom: actual (503.2,294)]
; Wake Island - USMC - Right Artillery: DropCartillery(342,171) ; [Failed @ x1 zoom: actual (341.9,171)]
; Wake Island - USMC - Middle Artillery: DropCartillery(340,176) ; [Failed @ x1 zoom: actual (340.9,175.7)]
; Wake Island - USMC - Left Artillery: DropCartillery(338,181) ; [Failed @ x1 zoom: actual (338,181.5)]

_________________
//TODO: Create kewl sig...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 13th, 2006, 2:21 pm 
Quote:
Try to find that out. Open up windowspy and then scroll to where those coordinates are then open upbf2 and keep mouse there.


Ok, cool....will do :) I'll post my results here. Thanks!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 18th, 2007, 12:45 am 
Does this work Online, is it Undectable??


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 22nd, 2007, 10:17 am 
if you do not compile it, you will have no problem with it...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 22nd, 2007, 10:18 am 
Lshink wrote:
You wouldn't happen to know what the coordinates are for 1280x1024 would you? :)


And for 800x600, has anyone got coordinates ?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 29th, 2007, 8:04 am 
Ok, Just one more question, How do U use it??


Report this post
Top
  
Reply with quote  
 Post subject: macros
PostPosted: May 12th, 2007, 2:39 am 
can someone tell me how to like download these macros or how to use them.......my xfire is p0ppab34r and thats a zero for p0p :D :D :D :D :D :D :D :D


Report this post
Top
  
Reply with quote  
 Post subject: Re: macros
PostPosted: May 12th, 2007, 6:02 am 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
p0ppabear wrote:
can someone tell me how to like download these macros or how to use them.......my xfire is p0ppab34r and thats a zero for p0p :D :D :D :D :D :D :D :D


try reading the tutorial in the help file. if you don't know what help file I mean, click on the logo on the top of tha page and read about the scripting language. there's a download link on the main page.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 30th, 2007, 3:36 am 
Offline

Joined: November 30th, 2007, 3:35 am
Posts: 1
i dunno what im doing wrong, but i can only drop one car at a time, isnt it supposed to be unlimited car drops?

thanks.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: specter333, sumon, XX0 and 24 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:
cron
Powered by phpBB® Forum Software © phpBB Group