Author Topic: What is a Snippit?  (Read 13301 times)

0 Members and 1 Guest are viewing this topic.

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
What is a Snippit?
« on: March 29, 2009, 09:38:36 AM »
0
A script snippit is a small stand alone script, or most commonly a SUB routine that performs basic functions.

Here's what I'd like to see everyone help with...

Lets write sub for everything. Make them semi-generic, so they can be plugged into any script.

If we can compile enough, we can basically write scripts by just using these modular sub routines.

Here's an example:

Snippit 1 - recall from a set runebook, rune 1 then rune 2 etc... to the last rune in the book then start at the beginning again.
Snippit 2 - auto attack something.
Snippit 3 - find a corpse and open it, drag/drop a type of loot. Gold, hides, maps, etc...
Snippit 4 - weight check sub routine
Snippit 5 - Bag of Sending sub

Ok, so there you have 5 little sub routines. Put them together and you have:

A - A leather gathering script
B - A gold farmer by killing/looting

Change out Snippet 3 and replace it with "Find Sheep and Shear Them" and you have a wool gathering script.

Add in a second Snippit 1 with BANKS and you have a script that drops off at bank.

Really, there is no limit to what we could do here. We start up a snippit, work on it, make changes and improvements as needed, then it can be used in many different scripts. Eventually, once the library gets filled, we'll be able to build complete, complicated scripts by simply selecting several snippits and using them together.

I recommend posting SUB snippits with a setup. Most times you need a few lines of setup. Like the Recall from named runebook example above. You would need a couple lines in the setup of the script to get the ID of the runebook. Please post any setup requirements with the snippit.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Tags: