• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

MoveEvent Advance Tutorial Hints Script, Easy To Configure!

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,782
Solutions
31
Reaction score
2,286
Location
Sweden?
100% Bad tabbed!
Hello otlanders,

Long story short, this script is configured to, when you step into a tile with configured actionid it will show tutorial hint: Example:


Also its including map marks script into this lua, ive tried some of the hints and they work 100%

Tested on: 0.3.6

Go to folder movements and open movements.xml, add this line below:
Code:
<movevent type="StepIn" actionid="10001-100019" event="script" value="tutorialtile.lua"/>

Now goto movements/scripts and create new lua and name it "tutorialtile.lua" and paste the script below:
Lua:
	local otswe_tutid = {
		first_tutorialid = 1,--(Tutorial How To Use Arrow Keys)
		second_tutorialid = 2, --(Tutorial How To Use Automap)
		third_tutorialid = 3, --(Tutorial Mark Your Quest Button, to open quest log)
		fourth_tutorialid = 4, --(Tutorial How To Open A Chest + Drag The Item)
		fifth_tutorialid = 5, --(Tutorial How To Drag The Armor From Your Bag To Your Armor Slot)
		sixth_tutorialid = 6, --(Tutorial How To Use A Torch)
		seventh_tutorialid = 7, --(Tutorial Which Will Mark Your Battle Screen)
		eighth_tutorialid = 8, --(Tutorial How To Open Dead Creatures)
		ninth_tutorialid = 9, --(Tutorial How To Drag Loot)
		tenth_tutorialid = 10, --(Tutorial How To Dig Holes With A Shovel)
		eleventh_tutorialid = 11, --(Tutorial How To Use Rope To Climb Up On Rope Spots)
		twelfth_tutorialid = 12, --(Tutorial This Will Open Outfit Window)
		thirteenth_tutorialid = 13, --(Tutorial How To Sell Items & Buy Items From Npc)
		fourteenth_tutorialid = 14, --Tutorial This Will Tell You To Look On The Map Marks)
		fifteenth_tutorialid = 15, --(Tutorial No Idea)
		sixteenth_tutorialid = 16, --(Tutorial This Will Warn You From White Skulls or Red Skulls)
		seventeenth_tutorialid = 17, --(Tutorial No Idea)
		eighteenth_tutorialid = 18, --(Tutorial This Will Mark Your Follow Button)
		nineteenth_tutorialid = 19 --(Tutorial This Will Mark Your Health Bar)
	}
	local otswe = {
		first_tutorial = 10001, -- Edit to unused actionid & storage & storage (Tutorial How To Use Arrow Keys)
		second_tutorial = 10002, -- Edit to unused actionid & storage (Tutorial How To Use Automap)
		third_tutorial = 10003, -- Edit to unused actionid & storage (Tutorial Mark Your Quest Button, to open quest log)
		fourth_tutorial = 10004, -- Edit to unused actionid & storage (Tutorial How To Open A Chest + Drag The Item)
		fifth_tutorial = 10005, -- Edit to unused actionid & storage (Tutorial How To Drag The Armor From Your Bag To Your Armor Slot)
		sixth_tutorial = 10006, -- Edit to unused actionid & storage (Tutorial How To Use A Torch)
		seventh_tutorial = 10007, -- Edit to unused actionid & storage (Tutorial Which Will Mark Your Battle Screen)
		eighth_tutorial = 10008, -- Edit to unused actionid & storage (Tutorial How To Open Dead Creatures)
		ninth_tutorial = 10009, -- Edit to unused actionid & storage (Tutorial How To Drag Loot)
		tenth_tutorial = 10010, -- Edit to unused actionid & storage (Tutorial How To Dig Holes With A Shovel)
		eleventh_tutorial = 10011, -- Edit to unused actionid & storage (Tutorial How To Use Rope To Climb Up On Rope Spots)
		twelfth_tutorial = 10012, -- Edit to unused actionid & storage (Tutorial This Will Open Outfit Window)
		thirteenth_tutorial = 10013, -- Edit to unused actionid & storage (Tutorial How To Sell Items & Buy Items From Npc)
		fourteenth_tutorial = 10014, -- Edit to unused actionid & storage (Tutorial This Will Tell You To Look On The Map Marks)
		fifteenth_tutorial = 10015, -- Edit to unused actionid & storage (Tutorial No Idea)
		sixteenth_tutorial = 10016, -- Edit to unused actionid & storage (Tutorial This Will Warn You From White Skulls or Red Skulls)
		seventeenth_tutorial = 10017, -- Edit to unused actionid & storage (Tutorial No Idea)
		eighteenth_tutorial = 10018, -- Edit to unused actionid & storage (Tutorial This Will Mark Your Follow Button)
		nineteenth_tutorial = 10019 -- Edit to unused actionid & storage (Tutorial This Will Mark Your Health Bar)
	}

	local otswe_mapmark = {-- [url]http://1.imgland.net/nr6WE51.png[/url] --//This link will show you the ids of all map marks
		{markid = 1, posistion = {x = 1000, y = 1000, z = 7}, description = "Temple"},
		{markid = 2, posistion = {x = 777, y = 654, z = 7}, description = "Shop"},  
	} 
function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) then
		if item.actionid == otswe.first_tutorial and getPlayerStorageValue(cid,otswe.first_tutorial) == -1 then
			doPlayerSendTutorial(cid, otswe_tutid.first_tutorialid)
			setPlayerStorageValue(cid, otswe.first_tutorial, 1)
	elseif item.actionid == otswe.second_tutorial and getPlayerStorageValue(cid,otswe.second_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.second_tutorialid)
		setPlayerStorageValue(cid, otswe.second_tutorial, 1)
	elseif item.actionid == otswe.third_tutorial and getPlayerStorageValue(cid,otswe.third_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.third_tutorialid)
		setPlayerStorageValue(cid, otswe.third_tutorial, 1)
	elseif item.actionid == otswe.fourth_tutorial and getPlayerStorageValue(cid,otswe.fourth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.fourth_tutorialid)
		setPlayerStorageValue(cid, otswe.fourth_tutorial, 1)
	elseif item.actionid == otswe.fifth_tutorial and getPlayerStorageValue(cid,otswe.fifth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.fifth_tutorialid)
		setPlayerStorageValue(cid, otswe.fifth_tutorial, 1)
	elseif item.actionid == otswe.sixth_tutorial and getPlayerStorageValue(cid,otswe.sixth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.sixth_tutorialid)
		setPlayerStorageValue(cid, otswe.sixth_tutorial, 1)
	elseif item.actionid == otswe.seventh_tutorial and getPlayerStorageValue(cid,otswe.seventh_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.seventh_tutorialid)
		setPlayerStorageValue(cid, otswe.seventh_tutorial, 1)
	elseif item.actionid == otswe.eighth_tutorial and getPlayerStorageValue(cid,otswe.eighth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.eighth_tutorialid)
		setPlayerStorageValue(cid, otswe.eighth_tutorial, 1)
	elseif item.actionid == otswe.ninth_tutorial and getPlayerStorageValue(cid,otswe.ninth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.ninth_tutorialid)
		setPlayerStorageValue(cid, otswe.ninth_tutorial, 1)
	elseif item.actionid == otswe.tenth_tutorial and getPlayerStorageValue(cid,otswe.tenth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.tenth_tutorialid)
		setPlayerStorageValue(cid, otswe.tenth_tutorial, 1)
	elseif item.actionid == otswe.eleventh_tutorial and getPlayerStorageValue(cid,otswe.eleventh_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.eleventh_tutorialid)
		setPlayerStorageValue(cid, otswe.eleventh_tutorial, 1)
	elseif item.actionid == otswe.twelfth_tutorial and getPlayerStorageValue(cid,otswe.twelfth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.twelfth_tutorialid)
		setPlayerStorageValue(cid, otswe.twelfth_tutorial, 1)
	elseif item.actionid == otswe.thirteenth_tutorial and getPlayerStorageValue(cid,otswe.thirteenth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.thirteentht_tutorialid)
		setPlayerStorageValue(cid, otswe.thirteenth_tutorial, 1)
	elseif item.actionid == otswe.fourteenth_tutorial and getPlayerStorageValue(cid,otswe.fourteenth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.first_tutorialid)
		setPlayerStorageValue(cid, otswe.fourteenth_tutorial, 1)
	elseif item.actionid == otswe.fifteenth_tutorial and getPlayerStorageValue(cid,otswe.fifteenth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.fifteenth_tutorialid)
		setPlayerStorageValue(cid, otswe.fifteenth_tutorial, 1)
	elseif item.actionid == otswe.sixteenth_tutorial and getPlayerStorageValue(cid,otswe.sixteenth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.sixteenth_tutorialid)
		setPlayerStorageValue(cid, otswe.sixteenth_tutorial, 1)
	elseif item.actionid == otswe.seventeenth_tutorial and getPlayerStorageValue(cid,otswe.seventeenth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.seventeenth_tutorialid)
		setPlayerStorageValue(cid, otswe.seventeenth_tutorial, 1)
	elseif item.actionid == otswe.eighteenth_tutorial and getPlayerStorageValue(cid,otswe.eighteenth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.eighteenth_tutorialid)
		setPlayerStorageValue(cid, otswe.eighteenth_tutorial, 1)
	elseif item.actionid == otswe.nineteenth_tutorial and getPlayerStorageValue(cid,otswe.nineteenth_tutorial) == -1 then
		doPlayerSendTutorial(cid, otswe_tutid.nineteenth_tutorialid)
		setPlayerStorageValue(cid, otswe.nineteenth_tutorial, 1)
		end
	end
end

	if isPlayer(cid) and getPlayerStorageValue(cid,otswe.fourteenth_tutorial) == -1 then
		for _, o  in pairs(otswe_mapmark) do
			doPlayerAddMapMark(cid, o.posistion, o.markid, o.description ~= nil and o.description or "")
			setPlayerStorageValue(cid, otswe.fourteenth_tutorial, 1)
		end
	return TRUE
end

Enjoy!
 
It's funny how you loop the smallest table instead of the big one haha, nice tho
 
so much repeated code it hurts me

Lua:
local otswe = {
    [10001] = 1, -- Edit to unused actionid & storage & tutorial stage(Tutorial How To Use Arrow Keys)
    [10002] = 2, -- Edit to unused actionid & storage & tutorial stage(Tutorial How To Use Automap)
    [10003] = 3, -- Edit to unused actionid & storage & tutorial stage(Tutorial Mark Your Quest Button, to open quest log)
    [10004] = 4, -- Edit to unused actionid & storage & tutorial stage(Tutorial How To Open A Chest + Drag The Item)
    [10005] = 5, -- Edit to unused actionid & storage & tutorial stage(Tutorial How To Drag The Armor From Your Bag To Your Armor Slot)
    [10006] = 6, -- Edit to unused actionid & storage & tutorial stage(Tutorial How To Use A Torch)
    [10007] = 7, -- Edit to unused actionid & storage & tutorial stage(Tutorial Which Will Mark Your Battle Screen)
    [10008] = 8, -- Edit to unused actionid & storage & tutorial stage(Tutorial How To Open Dead Creatures)
    [10009] = 9, -- Edit to unused actionid & storage & tutorial stage(Tutorial How To Drag Loot)
    [10010] = 10, -- Edit to unused actionid & storage & tutorial stage (Tutorial How To Dig Holes With A Shovel)
    [10011] = 11, -- Edit to unused actionid & storage & tutorial stage (Tutorial How To Use Rope To Climb Up On Rope Spots)
    [10012] = 12, -- Edit to unused actionid & storage & tutorial stage (Tutorial This Will Open Outfit Window)
    [10013] = 13, -- Edit to unused actionid & storage & tutorial stage (Tutorial How To Sell Items & Buy Items From Npc)
    [10014] = 14, -- Edit to unused actionid & storage & tutorial stage (Tutorial This Will Tell You To Look On The Map Marks)
    [10015] = 15, -- Edit to unused actionid & storage & tutorial stage (Tutorial No Idea)
    [10016] = 16, -- Edit to unused actionid & storage & tutorial stage (Tutorial This Will Warn You From White Skulls or Red Skulls)
    [10017] = 17, -- Edit to unused actionid & storage & tutorial stage (Tutorial No Idea)
    [10018] = 18, -- Edit to unused actionid & storage & tutorial stage (Tutorial This Will Mark Your Follow Button)
    [10019] = 19 -- Edit to unused actionid & storage  & tutorial stage(Tutorial This Will Mark Your Health Bar)
}
local otswe_mapmark = { --<a href="http://1.imgland.net/nr6WE51.png" target="_blank">http://1.imgland.net/nr6WE51.png</a> --//This link will show you the ids of all map marks
    {markid = 1, posistion = {x = 1000, y = 1000, z = 7}, description = "Temple"},
    {markid = 2, posistion = {x = 777, y = 654, z = 7}, description = "Shop"},  
}

function onStepIn(cid, item, position, fromPosition)
    if isPlayer(cid) then
        if(getPlayerStorageValue(cid,item.actionid) == -1) then --You don't need to check the array because you already know that its one of these since this script only runs if you step in a tile with this aid, so its already filtered :)
            doPlayerSendTutorial(cid, otswe[item.actionid])
            setPlayerStorageValue(cid, item.actionid, 1)
        end
    end 
    if isPlayer(cid) and getPlayerStorageValue(cid,otswe.fourteenth_tutorial) == -1 then
        for _, o  in pairs(otswe_mapmark) do
            doPlayerAddMapMark(cid, o.posistion, o.markid, o.description ~= nil and o.description or "")
            setPlayerStorageValue(cid, otswe.fourteenth_tutorial, 1)
        end
    end
    return TRUE
end
It should work the same way, performance improvements are too minimal to be noticeable, but script is much smaller and imo more readable, I hate tons of ifs, at least make a switch next time ;)
You could improve it even better by doing this:
Lua:
local otswe_mapmark = { --<a href="http://1.imgland.net/nr6WE51.png" target="_blank">http://1.imgland.net/nr6WE51.png</a> --//This link will show you the ids of all map marks
    {markid = 1, posistion = {x = 1000, y = 1000, z = 7}, description = "Temple"},
    {markid = 2, posistion = {x = 777, y = 654, z = 7}, description = "Shop"},  
}


function onStepIn(cid, item, position, fromPosition)
    if isPlayer(cid) then
        if(getPlayerStorageValue(cid,item.actionid) == -1) then
            doPlayerSendTutorial(cid, item.actionid - 10000) --<<<<<<<<<<<<<<<<<<<<<<<<<
            setPlayerStorageValue(cid, item.actionid, 1)
        end
    end 
    if isPlayer(cid) and getPlayerStorageValue(cid,otswe.fourteenth_tutorial) == -1 then
        for _, o  in pairs(otswe_mapmark) do
            doPlayerAddMapMark(cid, o.posistion, o.markid, o.description ~= nil and o.description or "")
            setPlayerStorageValue(cid, otswe.fourteenth_tutorial, 1)
        end
    end
    return TRUE
end
Now you don't even need the big table :)
 
Last edited:
Thanks, im learning :D
 
Back
Top