Author Topic: help for Auto Spot Mod for Battle Field 3 any advice?  (Read 1926 times)

Offline Layman

  • Chief squatting Hard
  • *
  • Posts: 18
  • Post quality +1/-0
  • Gender: Male
  • Acidmods User
help for Auto Spot Mod for Battle Field 3 any advice?
« on: June 04, 2012, 06:43:21 AM »
i had an idea for mod like the Evil Controller mod Auto Spot but instead of having it press the button when i aimed of fired i wanted one where it pressed it for me like every second. i wrote a piece of code to do this, but i need help please! the first thing is, is that later on i might want to add other things like the aim thing but ive tried this and all it does is stop me from using my triggers. and so on, i could just use a few points in the right direction, happy to share my code, will post below this so let me know if you can help in any way thanks!


[spoiler]
Code: [Select]
list      p=12F683        ; list directive to define processor
#include <p12F683.inc>    ; processor specific variable definitions

errorlevel  -302          ; suppress message 302 from list file

__CONFIG   _FCMEN_OFF & _IESO_OFF & _CP_ON & _CPD_ON & _BOD_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTOSCIO

org 0x000
goto main

;***** VARIABLE DEFINITIONS******************
w_temp        EQU     0x70        ; variable used for context saving
status_temp   EQU     0x71        ; variable used for context saving

count EQU 0x19
FLAGS EQU 0x20 ;software state register
TEMP1 EQU 0x26
TEMP2 EQU 0x27
TEMP5 EQU 0x2A
TEMP3 EQU 0x2C
Datareg1 EQU 0x2D
Datareg2 EQU 0x2E
Datareg3 EQU 0x2F
;*********GPIO pin names*****************
Sync EQU 3
BACKBUTTON EQU 5

;*****************************************

;*********FLAGS***************************
SPOTON equ 0
TRIGOUT equ 1
LEDON equ 2


;*******wait10ms********
Wait10ms
clrf TEMP2
movlw 0x0D
movwf TEMP1 ;rough 10ms timer for button debounce.
return

Wait1sec
call off
movlw 0x01 ;delay roughly 1 second
movwf Datareg3
call off
Delay
clrf Datareg1
call off
clrf Datareg2
movlw 0xFF
movwf Datareg2
call off
movlw 0xFF
movwf Datareg1
call off
goto Delay2
Delay2
call off
nop
nop
nop
nop
call off
decfsz Datareg1
goto Delay2
call off
decfsz Datareg2
goto Delay2
call off
decfsz Datareg3
goto Delay
call off
return

main
clrf GPIO
clrf FLAGS ;clear outputs and code status register
movlw 0x07
movwf CMCON0 ;comparators off
bsf STATUS, RP0 ;bank 1
movlw 0x0F ;start with 0-3 inputs (ADC read)
movwf TRISIO ;pin 0 & 1 & 5 out, all other inputs
movlw 0x51 ;Fosc/16, pin 0 analog
movwf ANSEL ;Right trigger is analog input
movlw 0x04
movwf WPU ;enable week pullups
bcf OPTION_REG, 7 ;enable all week pullups
bcf STATUS, RP0 ;bank 0

movlw 0x01 ;Left just, Vdd, channel 0
movwf ADCON0 ;module on.
movlw 0x10
movwf TEMP1
Wait4ADC
decfsz TEMP1, f
goto Wait4ADC ;acquisition time
bsf ADCON0, 1 ;start ADC
btfsc ADCON0, 1
goto $-1 ;wait for conversion to be done
movlw 0x40 ;about 0.5V from 2V ref
subwf ADRESH, w ;if f > W, C=1
btfsc STATUS, C ;ie- if trigger > 0.5V, then matrix
bsf FLAGS, TRIGOUT ;matrix config sources (output high)
bsf STATUS, RP0 ;bank 1
movlw 0x0C ;restore pin IO
movwf TRISIO
clrf ANSEL ;all digital now
bcf STATUS, RP0 ;bank 0
goto button

button
btfsc GPIO, Sync ;wait for button press should be BTFSS
goto button
call Wait10ms
hold
btfss GPIO, Sync ;on button press goto main loop should be BTFSC
goto hold
goto loop

off
btfsc GPIO, Sync ;waits for buttton press again turns off, should be BTFSS
return
call Wait10ms
release
btfss GPIO, Sync ;on buttton press goes to Button which
goto release ;waits for it to be pressed again to turn back on
bcf GPIO, LED2
goto button



loop ;main loop
call off ;checks if button has been pressed
BSF GPIO, LED2 ;turns on
call off
call Wait1sec ;waits 1 second
call off
BCF GPIO, LED2 ;turns off
call Wait1sec ;waits 1 sec
call off
goto loop ;repeats

END
  [/spoiler]

Offline Nevbox

  • Granny Spanker
  • *
  • Posts: 356
  • Post quality +12/-5
Re: help for Auto Spot Mod for Battle Field 3 any advice?
« Reply #1 on: June 04, 2012, 08:45:17 AM »
Sorry, but I don't think Battlefield 3 lets you spam the spot button :/ was the case in BC2, not %100 sure about bf3.

Offline Bigandrewgold

  • ½ Pint
  • *
  • Posts: 35
  • Post quality +0/-0
  • Acidmods User
Re: help for Auto Spot Mod for Battle Field 3 any advice?
« Reply #2 on: June 07, 2012, 09:40:05 AM »
a few things

-you are going to have to get the timing down so that it doesnt get "mod blocked"
-if you want other stuff to work along with it(do stuff when trigger is pulled, etc) you will need to recode it, since currently nothing can happen during the time it is waiting 1 sec.  You will need to make it so that it counts for 1 sec(roughly) in the background and when it gets there is does the auto clicking of the button.
-you said that the triggers dont work, make the triggers inputs instead of outputs and it should be fixed

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.5 © 2008-2012, SimplePortal