View unanswered posts | View active topics It is currently 24 Jan 2019 05:34

Forum rules

- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.

Reply to topic  [ 1 post ] 
Kill all <target> <2-100> alias 
Author Message

Joined: 12 Oct 2017 19:31
Posts: 10
For the Web Ui.


Description: Script to kill up to 100 targets. The alias requires at least
one argument, kill <human> or within single quotes 'dark elf', 'blue goblin', etc.
The second argument is used to kill a certain range of targets such as,
kill 'dark elf' 5, will attack the first 5 dark elves in the room.

Alias Command: ka
Script Type: Javascript

Usage: ka target (defaults to the first 10 targets) ka target 1-100

ka human (defaults to 10) . # this will attack the first 10 'humans' in the room
ka human 2 # will attack the first 2 humans
ka 'dark elf' 100 # will attack 100 dark elves in the room. ** Note the single quotes **


var target = args[1];
var bodycount = args[2];
var special = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelfth', 'thirteenth', 'fourteenth', 'fifteenth', 'sixteenth', 'seventeenth', 'eighteenth', 'nineteenth'];
var deca = ['twent', 'thirt', 'fort', 'fift', 'sixt', 'sevent', 'eight', 'ninet'];

if (! bodycount) {
bodycount = 10; // Change this to modify the default number of kills

function stringifyNumber(n) {
if (n < 20) return special[n];
if (n%10 === 0) return deca[Math.floor(n/10)-2] + 'ieth';
return deca[Math.floor(n/10)-2] + 'y-' + special[n%10];

// kill up to 100
for (var i=0; i<bodycount; i++) gwc.connection.send('kill ' + (stringifyNumber(i) + ' ' + target));

14 Nov 2017 23:37
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.