Author Topic: Attack Closest Based on Rep and Event Properties On Key  (Read 3047 times)

0 Members and 1 Guest are viewing this topic.

Offline tonysonomaTopic starter

  • Newbie
  • *
  • Posts: 4
  • Activity:
    0%
  • Reputation Power: 1
  • tonysonoma has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Attack Closest Based on Rep and Event Properties On Key
« on: May 22, 2018, 12:42:37 PM »
0
Hey guys long time lurker.  I am looking for some help with a recent mini project.

Goals for script
1. work onhotkey
2. Attack found target
3. Attack nearest arget
4. attack targets based upon being Red, orange, blue (non-npc), Grey, not guilded
5. cycle through available targets

I have pieced together a start but could use some direction. Thanks

Code: [Select]
;===========================================================================;
; Script Name: On hotkey attack targets based upon rep guild and distance   ;
; Author: Tony                                                              ;
; Version: 1.01                                                             ;
; Shard OSI/FS: OSI                                                         ;
; Revision Date: 05/22/2018                                                 ;
; Purpose: Attack nearest character that is blue, grey, orange, or red.     ;
; while not attacking NPCs or guild mates                                   ;
; Attributions: Based on a part of JaF's Player alert script.               ;
;===========================================================================;
;=========USER VARIABLE SETUP==========;

set %hotkey 1 ; hotkey to attack
set %modifierkey ctrl ; hotkey modifier change to one of the following : ctrl shift alt
set %guild STI ; set guilds you dont want to attack
set %guild2 GE ; set another guild you dont want to attack

;=====Variable Setup======;
set #lpc 200
set %AllForms IS_HS_OCB_NCB_XU_AV_SH_SC_EH_VD_EG_JG_BB_JD_HG_RF_WG_NF_FN_HN_GN_IN_LAB_MAB_SAB_NN_OGB_OAB_QAB_PAB_RAB_;%HumanForm , %ElfForm , %NinjaForm , %TalismanForm , %NecoForm , %SpellWeavingForm , %SavagePaintForm , %GargForm

;=============MAIN===========;
while #true
  onhotkey %hotkey %modifierkey
    {
      gosub findNextTarget
    }
 
;===========SUBS=============;
;===sub findNextTarget===;
sub findNextTarget
set %searchradius 10
for %searchradius 1 10
  {
    finditem %AllForms G_12 , %searchradius
    if #findcnt <> -1
      {
        for %i 1 #findCnt
          {
            set #findIndex %i
            if ( #findRep = 1 || #findrep = 4 || #findrep = 5 || #findrep = 6 ) && ( #findId <> #charID )
              {
                event property #findid
                wait 10
                  if guard in #property || healer in #property || quest in #property || priest in #property || mondain in #property || merchant in #property || gypsy in #property || sailor in #property || sculptor in #property || Pillar in #property || Stone in #property || sewer in #property || noble in #property
                    {
                      ignoreitem #findid  npcs
                    }
                  if %guild in #property || %guildTwo in #property
                    {
                      ignoreitem #findid guilds
                     
                    }
                  break
              }
          }
        gosub attack
      }
  }

;===sub attack===;   
sub attack
set #LTargetID #Findid
set #ltargetkind 1
event macro 27 0  ; mount
wait 20
return

Tags: