Страница 1 из 1

[share?] Пример закрытой чатовой торговли вещами.

Добавлено: Ср янв 07, 2009 12:33 pm
Святой Инквизитор
В общем решил выложить на общее обозрение своё чудо... как вы уже могли догадаться оно для пираток с командой @storage. Может кому станет интересно, а кто-то найдёт не доработки.

Код: Выделить всё

automacro gopa {

	storage "Yggdrasilberry" < 200
	inventory "Yggdrasilberry" < 200
	run-once 1
	priority 1
	exclusive 1
	call {
		do quit
}
}

automacro chating {

	run-once 1
	priority 2
	exclusive 1
	call {
		do conf dealAuto 0
		pause @rand(2,3)
		do chat create "S> 200pcs YGG = 5c |200 per deal|" 2 0 gygygggg
		pause @rand(2,3)
		do sit
		release detectDealyes
		release detectCredz
}
}

automacro detectDealyes {

	console /Requests a Deal/
	inventory "Yggdrasilberry" >= 200
	run-once 1
	priority 4
	call {
		pause @rand(1,2)
		do deal
		pause 10
		do deal no
		release detectDealyes
		release detectCredz
}
}



automacro detectDealno {
	console /Requests a Deal/
	inventory "Yggdrasilberry" < 200
	run-once 1
	priority 4
	exclusive 1
	call {
		pause @rand(2,3)
		do deal no
		pause 1
		do chat modify "Wait..." 2 0 gygyggg
		pause 1
		if (@invamount(Yggdrasilberry) >= 200) goto next1
		do c @storage
		pause 1
		if (@storamount(Yggdrasilberry) >= 200) goto next2
		do quit
:next2
		do storage get Yggdrasilberry 200
		pause 1
		do storage close
:next1
		pause 2
		do chat modify "S> 200pcs YGG = 5c |200 per deal|" 2 0 gygyggg
		do deal no
		release detectDealyes
		release detectDealno
		release detectCredz
}
}


automacro detectCredz {
	console /added Item to Deal: Unknown #14500 x (\d+)/
	inventory "Yggdrasilberry" >= 200
	run-once 1
	timeout 5
	priority 6
	call {
		if ($.lastMatch1 = 5) goto sell
		pause @rand(2,3)
		do deal no
		pause 1
		release detectCredz
		release detectDealyes
		stop
:sell
		pause 1
		do deal add @inventory(Yggdrasilberry) 200
		pause 1
		do deal
		pause 1
		pause @rand(3,4)
		do deal
		if (@invamount(Yggdrasilberry) >= 200) goto next2
		do c @storage
		pause 1
		do storage get Yggdrasilberry 200
		pause 1
		do storage close
:next2
		do deal no
		release detectCredz
		release detectDealyes
}
}

automacro overweight {
	console /That person is overweight; you cannot trade./
	run-once 1
	priority 7
	exclusive 1
	call {
		do deal no
		pause @rand(1,2)
		do chat modify "WEIGHT!" 2 0 gygyggg
		pause @rand(3,4)
		do chat modify "S> YGG 200pcs=5c |200 per deal!|" 2 0 gygygggg
		do deal no
		release detectDealyes
		release detectCredz
		release overweight
}
}
Сильно не бить)))