annuncio

Comprimi
Ancora nessun annuncio.

[euox] hotkey teleporter

Comprimi
X
 
  • Filtro
  • Ora
  • Visualizza
Elimina tutto
nuovi messaggi

  • [euox] hotkey teleporter

    feel like guy in movie teleport lol, i lkie it ))
    will work on analyzing targettile

    alpha version
    want to hear opinion of guru euox programmers, cause work this #ltargetkind, #lpc, onhotkey, sleep first time, and not really cool in analysing journal...
    codice:
    set %jindex #jindex
    set %dlpc 1000
    set %flpc 10000
    set %d 11
    set #lpc %dlpc
    set %i 0
    loop:
    onhotkey r
     gosub hotkey
    sleep 1
    goto loop
    
    sub hotkey
      set %i %i + 1
      set #lpc %flpc
      event macro 15 21
      set %sTime #systime
      gosub RelPorWaitForCurs %sTime
      if #result = ok
      {
         set %x #CHARPOSX
         set %y #CHARPOSY
         set %z #CHARPOSZ
         if #CHARDIR = 0 1 ;N
            set %y %y - %d
         if #CHARDIR = 1 2 ;NE
            set %y %y - %d
            set %x %x + %d
         if #CHARDIR = 2 1 ;E
            set %x %x + %d
         if #CHARDIR = 3 2 ;SE
            set %x %x + %d
            set %y %y + %d
         if #CHARDIR = 4 1 ;S
            set %y %y + %d
         if #CHARDIR = 5 2 ;SW
            set %y %y + %d
            set %x %x - %d
         if #CHARDIR = 6 1 ;W
            set %x %x - %d
         if #CHARDIR = 7 2 ;WN
            set %x %x - %d
            set %y %y - %d
         set #ltargetx %x
         set #ltargety %y
         set #ltargetz %z
         while #targcurs = 0
         {
           if ( #systime > %sTime + 950 )
           {
              return
           }
         }
         event macro 22 0
         set #lpc %dlpc
      }
    return
    
    sub RelPorWaitForCurs
    ;%1 time of starting casting
    set %ChangeTargKindTime %1 + 850
    set %TargKindChanged #false
    set %fl #true
    while %fl
    {
          set %njindex #jindex
          for %j %jindex %njindex
          {
              scanjournal %j
              if your_consentration_is_disturbed. in #journal && : notin #journal
              {
                 set %result disturbed
                 goto _RelPorWaitForCursExit
              }
              if the_spell_fizzles. in #journal && #CHARNAME in #journal
              {
                  set %result disturbed
                  goto _RelPorWaitForCursExit
              }
              if  #systime > %ChangeTargKindTime
              {
                set #ltargetkind 2
                set %result ok
                goto _RelPorWaitForCursExit
              }
          }
          set %jindex %njindex + 1
    }
    _RelPorWaitForCursExit:
    set #targcurs 0
    return %result
    ;end RelPorWaitForCurs
    Ultima modifica di fnurov; 10-05-2008, 05:47.

  • #2
    advanced mounting hirye

    are there some system variables to enshure that findem has been realyy proceeded and fidx, findy modified? :/

    codice:
    set %PetId FPZD
    set %jindex #jindex
    set %dlpc 1000
    set %flpc 10000
    set %d 11
    set #lpc %dlpc
    
    gosub init
    
    loop:
    onhotkey r
     gosub telefar
    onhotkey z alt
     gosub telesitpet
    sleep 1
    goto loop
    
    sub telefar
      set #lpc %flpc
      event macro 15 21
      set %sTime #systime
      gosub RelPorWaitForCurs %sTime
      if #result = ok
      {
         set %x #CHARPOSX
         set %y #CHARPOSY
         set %z #CHARPOSZ
         if #CHARDIR = 0 1 ;N
            set %y %y - %d
         if #CHARDIR = 1 2 ;NE
            set %y %y - %d
            set %x %x + %d
         if #CHARDIR = 2 1 ;E
            set %x %x + %d
         if #CHARDIR = 3 2 ;SE
            set %x %x + %d
            set %y %y + %d
         if #CHARDIR = 4 1 ;S
            set %y %y + %d
         if #CHARDIR = 5 2 ;SW
            set %y %y + %d
            set %x %x - %d
         if #CHARDIR = 6 1 ;W
            set %x %x - %d
         if #CHARDIR = 7 2 ;WN
            set %x %x - %d
            set %y %y - %d
         set #ltargetx %x
         set #ltargety %y
         set #ltargetz %z
         while #targcurs = 0
         {
           if ( #systime > %sTime + 950 )
           {
              return
           }
         }
         event macro 22 0
         set #lpc %dlpc
      }
    return
    
    sub telesitpet
      set #lpc %flpc
      finditem %PetId
      If #FindCnt = 0
      {
       return
      }
      event macro 1 0 all follow me
      set %sTime #systime
      event macro 15 21
      exevent popup %petid 2
      target
      event macro 23 0
      gosub RelPorWaitForCurs %sTime
      if %result <> ok
      {
      event macro #result
      }
      if #result = ok
      {
         finditem %PetId
         if #findx > #charposx
         {
            set #ltargetx #FINDX + 1
         }
         else
         {
             set #ltargetx #FINDX - 1
         }
         if #findy > #charposy
         {
            set #ltargety #FINDy + 1
         }
         else
         {
             set #ltargety #FINDy - 1
         }
         set #ltargetz #FINDZ
         while #targcurs = 0
         {
           if ( #systime > %sTime + 1500 )
           {
              return
           }
         }
         event macro 22 0
         gosub ScanJournalForError
         if #result = ok
         {
         set %i 0
            repeat
                  finditem %PetId
                  if #findcnt = 1
                  {
                     set #LOBJECTID %PetId
                     event macro 17 0
                  }
            until #findcnt = 0 || ( #systime > %sTime + 5000 )
            set #targcurs 0
         }
         set #lpc %dlpc
      }
    return
    
    sub RelPorWaitForCurs
    ;%1 time of starting casting
    set %ChangeTargKindTime %1 + 800
    set %TargKindChanged #false
    set %fl #true
    while %fl
    {
          set %njindex #jindex
          for %j %jindex %njindex
          {
              scanjournal %j
              if your_consentration_is_disturbed. in #journal && : notin #journal
              {
                 set %result disturbed
                 goto _RelPorWaitForCursExit
              }
              if the_spell_fizzles. in #journal && #CHARNAME in #journal
              {
                  set %result disturbed
                  goto _RelPorWaitForCursExit
              }
              if  #systime > %ChangeTargKindTime
              {
                set #ltargetkind 2
                set %result ok
                goto _RelPorWaitForCursExit
              }
          }
          set %jindex %njindex + 1
    }
    _RelPorWaitForCursExit:
    set %jindex %njindex + 1
    return %result
    ;end RelPorWaitForCurs
    
    Sub ScanJournalForError
    _ScanJournalForErrorStart:
          set %njindex #jindex
          for %j %jindex %njindex
          {
              scanjournal %j
              if the_location_is_too_far_away in #journal && : notin #journal
              {
                 set %result error
                 goto _ScanJournalForErrorExit
              }
              if target_cannot_be_seen. in #journal && : notin #journal
              {
                 set %result error
                 goto _ScanJournalForErrorExit
              }
              if cannot_teleport_to_that_spot. in #journal && : notin #journal
              {
                 set %result error
                 goto _ScanJournalForErrorExit
              }
    
          }
          if %njindex <> #jindex
          {
                set %jindex %njindex + 1
                goto _ScanJournalForErrorStart
          }
    set %result ok
    set %jindex %njindex + 1
    _ScanJournalForErrorExit:
    return %result

    Commenta

    Sto operando...
    X