Toribash
Original Post
[REL] ACPATCH & Toribash Eye & Go Translater
I must say you are sorry. English version is made in translater. I hope that everything will be clear.

Introduction
Many might have thought: "it would be cool if in the lua scripts could communicate with the server". And the truth. This opens up great prospects in terms of ideas for scripts, and indeed in our time, it communicates with the server(Well, except for any irons). So am I've thought about it and made a patch that opens these horizons. The result of my efforts I was very pleased and I immediately made a few relatively simple scripts.

ACPATCH
The patch adds a few lua libraries and piece of me - the startup script at start Toribash.
What possibilities reveals this patch:
1) the Ability of http requests
This opportunity gives us library luasocket. And gives it even more. It includes: SMTP, HTTP, FTP and module-assistant.
2) Working with Json
Library dkjson. Here perhaps even nothing to add.
3) startup script
If you then need to add a new startup script, you only need to use pre-function autorun_on and autorun_off.
Example:
local function commands(cmd)
	if cmd=='on' then
		if autorun_on("ScriptName") then
			echo('On')
		else
			echo('Already on')
		end
	elseif cmd=='off' then
		if autorun_off("ScriptName") then
			echo('Off')
		else
			echo('Already off')
		end
	end
end

add_hook("command", "sctiptnamecommand", commands)

Not bad, huh? And finally, one more thing:

But how, you ask, I tell the user that he needs to put this patch to the script worked, if he downloaded it from the section Scripts and know't know what it is?

Very simple: after you install the patch in a global variable ACPATCH be true. Based on this, you can write the following code:
if not ACPATCH then
	echo("You need install the ACPATCH.")
	echo("http://dnuwe.ru/toribash/ACPATCH.exe")
	return
end
During the installation you should specify the folder with the game. Exemple: Cgames\Toribash

Also I consider it my duty to tell you: do not place such patches, if you download them from untrusted sources. This patch can easily steal your account because it is stored in the clear(hi Hampa, you need to fix it).
DOWNLOAD



Toribash Eye
I think everyone saw BigBro well, or this... well, this... well from rubash. Now it is the same only in the game.
For those who are in the tank: this Script is used to track the online players.
Additional descriptions of the script is probably not required. When run, he will tell you everything.
DOWNLOAD


Go Translater
The name of the script already half has declassified its purpose.
Not everyone can speak several languages, and this creates a barrier. Now, the script converts your messages or all messages, or messages tech who you added to the list.

About the list a bit more:
On some servers, such as bet servers, there are many people and chat there is torn to pieces, it can cause you a good brakes. Now you and your foreign friend went on such a server and you want to script it's been translated, and all others not. You add your friend's list and switch off the translation of all. The profit.

The rest of you and he himself will tell. Although I said so unnecessary.
DOWNLOAD


That's all. If suddenly some bugs I wait for them here, and better in private messages.








Введение
Наверняка многие задумывались: "как было бы круто, если бы в lua скриптах можно было бы общаться с сервером". И правда. Это открывает большие горизонты в плане идей для скриптов, да и вообще в наше время всё общается с серверами(Ну кроме всяких там утюгов). Вот и я тоже об этом задумался и сделал некий патч, который открывает эти горизонты. Результат моих трудов меня очень порадовал и я сразу же сделал пару относительно простых скриптов.

ACPATCH
Патч добавляет несколько lua-библиотек и фишку от меня - автозагрузка скрипта при старте Toribash.
Какие же возможности открывает нам этот патч:
1) Возможность http запросов
Эту возможность нам дает библиотека luasocket. И дает она даже больше. В её состав входят: SMTP, HTTP, FTP а также модули-помощники.
2) Работа с Json
Библиотека dkjson. Здесь пожалуй даже добавить нечего.
3) Возможность автозагрузки скрипта
Если вам вдруг понадобится добавить возможность автозагрузки скрипта, то вам нужно будет лишь использовать уже готовые функции autorun_on и autorun_off.
Пример:
local function commands(cmd)
	if cmd=='on' then
		if autorun_on("ScriptName") then
			echo('On')
		else
			echo('Already on')
		end
	elseif cmd=='off' then
		if autorun_off("ScriptName") then
			echo('Off')
		else
			echo('Already off')
		end
	end
end

add_hook("command", "sctiptnamecommand", commands)

Вроде неплохо, да? И напоследок еще кое-что:

А как-, спросите вы, -мне повествовать пользователю, что ему нужно поставить этот патч чтобы скрипт работал, если он скачал его из раздела Scripts и знать не знает что это такое?

Очень просто: после установки патча в глобальной переменной ACPATCH будет true. Опираясь на это можно написать следующий код:
if not ACPATCH then
	echo("You need install the ACPATCH.")
	echo("http://dnuwe.ru/toribash/ACPATCH.exe")
	return
end

При установке нужно указывать папку с игрой. Пример Cgames\Toribash


Так же считаю своим долгом донести до вас: не ставьте подобные патчи, если вы скачиваете их из непроверенных источников. Подобным патчем можно запросто украсть ваш аккаунт т.к. он хранится в открытом виде(Привет хампа, тебе нужно это исправить).

DOWNLOAD



Toribash Eye
Я думаю все видели BigBro ну или этот... ну этот... ну от rubash. Так вот это тоже самое только в игре.
Для тех кто в танке: Скрипт этот служит для отслеживания онлайн игроков.
Дополнительного описания скрипт пожалуй не требует. При запуске он сам вам все расскажет.
DOWNLOAD


Go Translater
Название скрипта уже на половину рассекретило его предназначение.
Далеко не каждый человек может общаться сразу на нескольких языках, и это создает некий барьер. Так вот, скрипт переводит ваши сообщения, или сообщения всех, или сообщения тек кого вы добавили в список.

О списке чуть подробнее:
На некоторых серверах, например на bet серверах, бывает много народа и чат там разрывается на куски, это может создать вам неплохие тормоза. Так вот вы с вашим иностранным другом отправились на такой сервер и вы хотите чтобы скрипт его переводил, а всех остальных нет. Вы добавляете вашего друга в список и выключаете перевод всех. Профит.

Остальное он вам и сам расскажет. Хотя я и так сказал лишнего.
DOWNLOAD



Вот и все. Если вдруг какие-то баги я жду их здесь, а лучше в личных сообщениях.
Looks pretty cool. Can you release the source code?
Signature temporarily out of order.
This is not necessary. You can compare the old script with the new /script/sturtup.lua. There a little. And .exe file is winrar archive.
Last edited by ASSASSIN92; May 3, 2014 at 06:24 PM.
Awesome, thanks a bunch.
Selling Kung Fu Master Beard $250 USD. Non-negotiable. Now accepting bitcoin! I'll accept an offer as low as 0.15BTC!
Pretend you're as elite as us old schoolers with this unique old schooler only beard!
DesertPunk

Please click this
Visit Buy something from my Poor Quality 3D/2D/Pixel/Photography/Sounds/Writing/Scripts/Anything Shop