hans henrik
Active Member
Playing with OTClientV8 scripting, but seems most of the documentation has vanished, the client had it's own forum ( http://************ ) which is now dead...
Anyone got a OTClientV8 scripting cheat sheet?
so far I've got:
g_game APIs can be found under
player APIs can be found at otcv8-dev/src/client/localplayer.h at master · OTCv8/otcv8-dev (https://github.com/OTCv8/otcv8-dev/blob/master/src/client/localplayer.h#L36) , like
script to convert 100gp to 1 plat, 100 plat to 1 cc, 100 cc to 1 (whatever your server use beyond cc):
Anyone got a OTClientV8 scripting cheat sheet?
so far I've got:
g_game APIs can be found under
public:
here: otcv8-dev/src/client/game.h at master · OTCv8/otcv8-dev (https://github.com/OTCv8/otcv8-dev/blob/master/src/client/game.h#L170) like void talk(const std::string& message);
means g_game:talk("message");player APIs can be found at otcv8-dev/src/client/localplayer.h at master · OTCv8/otcv8-dev (https://github.com/OTCv8/otcv8-dev/blob/master/src/client/localplayer.h#L36) , like
double getHealth() { return m_health; }
means player:getHealth()
Code:
function getManaPercent()
return (player:getMana() / player:getMaxMana()) *100
end
function getHealthPercent()
return (player:getHealth() / player:getMaxHealth()) *100
end
function hasManashield()
return (player:getStates() & (1 << 4)) ~= 0
end
script to convert 100gp to 1 plat, 100 plat to 1 cc, 100 cc to 1 (whatever your server use beyond cc):
Code:
for i, container in pairs(getContainers()) do
for j, item in ipairs(container:getItems()) do
if item:getCount() == 100 and (item:getId() == 3031 or item:getId() == 3035 or item:getId() == 3043) then
g_game.use(item)
delay(100)
return "retry"
end
end
end