2010-01-01 07:55:00
Console Scripts
Author Message
Willy
Administrator

Post: #1
Console Scripts
For all you that didn't know you can write simple scripts in Kynto via the console.

Just type :console

Here is something to get you started

function newMessage(obj)
{
Kynto.createAlert(obj.U + ": " +obj.M);
}

Kynto Developer

IP Address: Logged

2 yearss ago
Sam
Kynto

Post: #2
RE: Console Scripts
function newMessage(obj)
{
var msg = obj.M; //cba typing obj.M kk?
if(msg.substring(0,7) == ":alert ") {
Kynto.createAlert(msg.substring(7,msg.length));
}
}

Its fun to fake admin!

Your mum is new!

IP Address: Logged

2 yearss ago
Willy
Administrator

Post: #3
RE: Console Scripts
API has been updated.

Kynto.createAlert("creats an alert");
Kynto.sendChat("sends a chat bubble");
Kynto.createNotification("creates a notification");

Functions you can override:

function newMessage(obj)
{
// obj.U (username) obj.M (message)
}

function addUser(obj)
{
//obj.U (username)
}

function removeUser(obj)
{
//obj.U (username)
}

function userStatus(obj)
{
//obj.U (username) obj.S (status)
}

Have fun!

Kynto Developer

IP Address: Logged

2 yearss ago
Alan
Kynto

Post: #4
RE: Console Scripts
Hey,
Just come on the forums from my phone sadly we cant have Kynto on Andriod :( but anyways what is the use for :console?
looks fun for a developer thou..

Alan

Kynto Script Kiddie!

IP Address: Logged

2 yearss ago
lewisfroom
Kynto

Post: #5
RE: Console Scripts
Any more API stuff?

I'm new!

IP Address: Logged

2 yearss ago
Willy
Administrator

Post: #6
RE: Console Scripts
/*
* Clone status
*/

function userStatus(obj)
{
switch(obj.S)
{
case "brb":
Kynto.sendChat(":" + obj.S);
break;
case "online:
Kynto.sendChat("back");
break;
}
}

Kynto Developer

IP Address: Logged

2 yearss ago
Del
Kynto

Post: #7
RE: Console Scripts
var person = "Willy";
var yourname = "Del";

function newMessage(obj){
var msg = obj.M;
if(msg.substring(0, 6) == ":copy " && obj.U == yourname){
person = msg.substring(6, msg.length);
}
if(obj.U == person){
Kynto.sendChat(msg);
}
}

change Del to your name and type :copy NAME into the chat bar to copy them

I'm new!

IP Address: Logged

2 yearss ago
Willy
Administrator

Post: #8
RE: Console Scripts
Nice one! :D

var tiles = ["0_0", "0_2", "5_2"];

function moveMe()
{
var tile = array_rand(tiles).split(/_/);
Kynto.moveUser(tile[0], tile[1]);
}

moveMe();


function array_rand(array)
{
return array[Math.floor(Math.random()*array.length)];
}

Can be ran on a timer :)

Kynto Developer

IP Address: Logged

2 yearss ago
Willy
Administrator

Post: #9
RE: Console Scripts
A simple bot

var messages = ["Bots are coool", "irobot", "I'm not a bot!!", "kynto rocks"];
var tiles = ["0_0", "1_4", "0_6", "6_0", "7_10"];

setInterval("run()", 3000);

function run()
{
var tile = array_rand(tiles).split(/_/);
Kynto.moveUser(tile[0], tile[1]);

var message = array_rand(messages);
Kynto.sendChat(message);
}

function array_rand(array)
{
return array[Math.floor(Math.random()*array.length)];
}

Kynto Developer

IP Address: Logged

2 yearss ago
Thall3s
Kynto

Post: #10
RE: Console Scripts
Hello, i'm new here. Cool idea this, what language is this game programmed in? C#, Java, AS3? Sorry bad english, i'm from Brazil. =]

I'm new!

IP Address: Logged

1 years ago
© Kynto.com 2012