Author Topic:  (Read 4845 times)

0 Members and 1 Guest are viewing this topic.

bennyspa

  • Guest
« on: October 29, 2009, 07:38:44 AM »
0
Hi, I've written this script but I don't know to finish it.

Can anyone help me with the recalling and the dropping items steps? (and to make it better).

This is the code for the script:

Code: [Select]
;===============================
; Script Name: Chicken Killer & Looting
; Author: Bennyspa
; Version: 0.3
; Client Tested with: 7.0.0.2
; EUO version tested with: 1.5 v.154
; Shard OSI / FS:  Free Server
; Revision Date: NA
; Public Release: 29/10/09
; Purpose: Kill Chickens to obtain feathers.
;===============================

set %chicken C_AG ; NPC to kill
set %weapon XXXXXXX ;Weapon ID


;Kill NPC

    finditem %chicken G_12
    if #findkind <> -1

    set #ltargetid #findid
    event macro 27 0
    wait 10
   
;Search corpse & use weapon on it.

     finditem yfm g_2
    {
    if #findkind = -1
       return
    else
       { 
       ignoreitem #findid
       set #ltargetid #findid
       set #lobjectid %weapon
       event macro 17 0
       target
       event macro 22 0
       wait 10
       }
    }
   
;Looting Feathers

set %featherType VLK
set %featherBag #backpackId

    set !toFind %featherType
    set !toFind %featherType , _ ,
    findItem !toFind C_ , #contId
    if #findcnt <> 0
    {
       for !i 1 #findCnt
       {
          set #findIndex !i
          exEvent drag #findId #findStack
          wait 15
          exEvent dropc %featherBag
          wait 50
       }
    }
   
;Weigth - Recall - Secure Container

   set %RunebookHOME XXXXXXX ;Secure Container Runebook
   set %RunebookNPC XXXXXXX ;NPC Location Runebook
   set %SecureId XXXXXXX ;House Secure ID

   if #weight > 350 ; Change for your PJ
   
       {
{ ;Recall to Secure Container
set #LTARGETID %RunebookHOME
event macro 15 31
wait 50
event macro 22 0
}

{ ;Drop Feathers on Secure Container
}

{ ;Recall to Chicken's Location
}
       }
      
repeat

Offline Coragin

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +57
  • Referrals: 1
    • View Profile
« Reply #1 on: October 29, 2009, 07:40:32 AM »
0
TM has some GREAT Runebook handling subs for recalling and gating.  Why try and re-invent the wheel?  Search the script part of the boards and you will find it.  Its simply the best.
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
« Reply #2 on: October 29, 2009, 08:51:34 AM »
0
Hi Bennyspa - nice effort so far!!

I would highly recommend TM's runebook subs that can be found Here.

If you would entertain an organizational suggestion I would recommend setting all of your variable values at the beginning of the script to make it a little more user-friendly. Also, consider using subroutines within the script with a loop of Gosubs as the mainloop of the script.

So, for example:
Code: [Select]
set %chicken C_AG ; NPC to kill
set %weapon XXXXXXX ;Weapon ID
set %featherType VLK
set %featherBag #backpackId
set %RunebookHOME XXXXXXX ;Secure Container Runebook
set %RunebookNPC XXXXXXX ;NPC Location Runebook
set %SecureId XXXXXXX ;House Secure ID

Mainloop:
   Gosub Recalltochickenspot
   Gosub Findchicken
   Gosub Etc,yougetthepoint
goto Mainloop ;yes there are better ways but for illustrative purposes, here is a goto ;)

As for logic, I notice that you don't have anything in place to move to a chicken when you find one, it assumes you are standing next to the chicken when you kill it. You could scan for the chicken, then when you find it pathfind to it then head to your kill/skin/loot loop.

Just a couple of thoughts to start, hope this is helpful!!

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
« Reply #3 on: October 29, 2009, 08:53:08 AM »
0
Oh, also, if you are going to scan for a kill then pathfind to it there is no reason not to include all other bird types in your %chicken variable ;)
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline cgeorgemo

  • Hero Member
  • *
  • Posts: 586
  • Activity:
    0%
  • Reputation Power: 5
  • cgeorgemo has no influence.
  • Gender: Male
  • I'm Brian...cgeorgemo is Curious George Missouri
  • Respect: +19
  • Referrals: 1
    • View Profile
« Reply #4 on: October 29, 2009, 09:47:19 AM »
0
Oh, also, if you are going to scan for a kill then pathfind to it there is no reason not to include all other bird types in your %chicken variable ;)
Such as Harpies, Stone Harpies, and Paragon versions of both of these...... I'm thinking of the Harpy nest in Ilshenar
Sarcasm is your body's natural defense against stupidity.

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
« Reply #5 on: October 29, 2009, 09:55:25 AM »
0
Oh, also, if you are going to scan for a kill then pathfind to it there is no reason not to include all other bird types in your %chicken variable ;)
Such as Harpies, Stone Harpies, and Paragon versions of both of these...... I'm thinking of the Harpy nest in Ilshenar
And Ravens, Eagles, Blue Jays, or whatever other birds are floating around in the game nowadays.

It also just occurred to me that my point about pathfinding to the kill before killing it was somewhat moot since the attacking of the mob will make it come to you anyhow.
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline cgeorgemo

  • Hero Member
  • *
  • Posts: 586
  • Activity:
    0%
  • Reputation Power: 5
  • cgeorgemo has no influence.
  • Gender: Male
  • I'm Brian...cgeorgemo is Curious George Missouri
  • Respect: +19
  • Referrals: 1
    • View Profile
« Reply #6 on: October 29, 2009, 10:19:57 AM »
0
You'd have to go to the smaller ones if you were a caster they'd drop with one hit.
Sarcasm is your body's natural defense against stupidity.

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
« Reply #7 on: October 29, 2009, 10:23:35 AM »
0
You'd have to go to the smaller ones if you were a caster they'd drop with one hit.

Event Macro 27 0 = Attack Last. This is definitely meant for Malee rather than casting.

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline cgeorgemo

  • Hero Member
  • *
  • Posts: 586
  • Activity:
    0%
  • Reputation Power: 5
  • cgeorgemo has no influence.
  • Gender: Male
  • I'm Brian...cgeorgemo is Curious George Missouri
  • Respect: +19
  • Referrals: 1
    • View Profile
« Reply #8 on: October 29, 2009, 10:26:04 AM »
0
You'd have to go to the smaller ones if you were a caster they'd drop with one hit.

Event Macro 27 0 = Attack Last. This is definitely meant for Malee rather than casting.

X
You see what happens when you don't know all the Event Macro codes?
Sarcasm is your body's natural defense against stupidity.

bennyspa

  • Guest
« Reply #9 on: October 29, 2009, 12:35:42 PM »
0
I'll check this script.

In the script, the pj don't follow the chickens cause they spawn on its side, but it's easy to make the pj follow them, by the way, the script made it before.

Offline cgeorgemo

  • Hero Member
  • *
  • Posts: 586
  • Activity:
    0%
  • Reputation Power: 5
  • cgeorgemo has no influence.
  • Gender: Male
  • I'm Brian...cgeorgemo is Curious George Missouri
  • Respect: +19
  • Referrals: 1
    • View Profile
« Reply #10 on: October 29, 2009, 01:01:34 PM »
0
Hi, I've written this script but I don't know to finish it.

Halt ;Ends script

 ;)
Sarcasm is your body's natural defense against stupidity.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
« Reply #11 on: November 01, 2009, 09:00:57 AM »
0
Hi, I've written this script but I don't know to finish it.

Halt ;Ends script

 ;)

Funny man,.  but i new soon or later you would pickup a few commands ..
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Tags: