The issue
there is, as known, a steady discussion about this server being corrupted by players/staff/reptiloids/youNameIt. I disagree.
It's quite obvious though that only a small fraction of gameplay is used, simply because all the world is using the same scripts. The most prominent example is MB's heartwood script. This inflicts gameplay heavily: archery/carpentry based templates profit, while other runics are not so abundant. I don't care so much about the gold and market, but it's clear that template variety is discouraged by this.
MB's script, while quite brilliant, is a negative example on how to code (sorry mate - I'm not the praising type): trying to alter it will take days.
The idea
Let's try and guide people, so they can develop their own ideas
So instead of just sitting there and complaining, I'd rather suggest to enable people to craft their own scripts, and make them more understandable, sizable, deployable.
This is in the hope that we will, for some time, get new ideas on how to do things. We will see what comes out of this.
Of course everybody can read, research and educate themselves. But why leave them alone? Some will have great ideas but will not implement them, because they do not have the time. Others will try to use scripts but fail, or want to make them better but cannot do so.
Hence: if we simplify the way scripts are written, we make more and better options on how to interact, how to play.
In the sense of Open Source development: sharing is caring.
I'll just start now - join if you like!
Basics
explain
- make a header section that explains what the script does. keep that short
- also, explain what known issues are in it. mark open spots with TODO
- if possible: enter a version number
Code: Select all
////////////////////////////////////
// This macro is designed for //
// training alchemy from 30. Have //
// 5 empty kegs on you and a lot //
// of mortars and pestals. This //
// macro only makes PVP worthy //
// potions to minimize waste. //
// //
// Turn on loop and click play! //
// //
// ~~Made by kdivers~~ //
////////////////////////////////////
- who are you? how can we contact you in case we have questions?
Code: Select all
// made by MB: https://www.uogdemise.com/community/memberlist.php?mode=viewprofile&u=59
- use readable, self-explaining names for variables
- make them lengthy, to minimize the likelihood to collide with other scripts
- follow a naming pattern with all names, like place/purpose/effect
- utilize the most common language in use (here: english)
Code: Select all
if not @findobject 'HeartwoodTailorQuestGiver'
promptalias 'HeartwoodTailorQuestGiver'
endif
- cut your script in small, readable units
- begin each unit with a comment that explains what it does
- each unit should be able to stand for itself, so it can be cut and tested/re-used by itself
Code: Select all
//make sure there are always 2 sewing kits
while counttype 0xf9d 'any' 'backpack' < 2
usetype 0x1eb8 'any' 'backpack'
waitforgump 0x38920abd 15000
replygump 0x38920abd 8
waitforgump 0x38920abd 15000
replygump 0x38920abd 44
waitforgump 0x38920abd 15000
endwhile
- be very strict about using serials! if you need them, use promptalias
- make it very clear what prerequisites are required and list them in a comment section
- find a public place where to maintain your script. provide links to it
Code: Select all
//1. Character needs Fletching, Carpentry and Tinkering, a Fletching Bonus talisman saves resources
//2. FletcherDropoff container needs bolts, ingots, boards in it
//3. FletcherRunebook needs 1st rune to be Dropoff location and 2nd rune near Heartwood entrance
//4. Start in Heartwood with a beetle full of only boards. Have crafted tinker tools, 40 ingots, and 200 bolts in your pack or start at your Dropoff location to restock these items
//5. The macro tries to feed your beetle meat every 2 hours. If you have magery it will create the food for you.
//6. If multiple stacks of boards at your dropoff, script will begin encountering errors when one of the stacks drop below 1600, combine them before this happens
debugging
- write feedback to the journal f.e. by using msg command
- try breaking the script by doing stupid things while running it; write down what happens
- make it robust by finding counter measures against those things
- avoid player interaction! (in the sense of "don't make me think", if you want to enforce player interaction that's fine)
All of this may seem as if I know about coding. I don't. But I know when I can read and use code and when not.