This script will allow you to mine ore, gain exp, and level up. You will need to change the player positions, and the item numbers to fit your game.


Put This in Sub UseItem

     X = GetPlayerX(Index)

    Y = GetPlayerY(Index)

    Map = GetPlayerMap(Index)

   

    If ItemNum = 2 Then ' The pick axe

    If Map = 2 And X = 13 And Y = 9 Then ' The spot on the map.

    Call MiningSkill(Index)

    End If

    End If

 Put This somewhere not in a Sub.

Sub MiningSkill(Index)

MiningLevel=GetVar("skillset.ini", ConvertToString(GetPlayerLogin(Index))&"_"&ConvertToString(GetPlayerName(Index)), "MiningLevel")

MiningExp=GetVar("skillset.ini", ConvertToString(GetPlayerLogin(Index))&"_"&ConvertToString(GetPlayerName(Index)), "MiningExp")

MiningTNL=GetVar("skillset.ini", ConvertToString(GetPlayerLogin(Index))&"_"&ConvertToString(GetPlayerName(Index)), "MiningTNL") 

    If MiningLevel ="" Then MiningLevel = 1

    If MiningExp ="" Then MiningExp = 0

    If MiningTNL ="" Then MiningTNL = 100

    MiningLevel = Int(MiningLevel)

    MiningExp = Int(MiningExp)

    MiningTNL = Int(MiningTNL)

    MaxMiningLevel = 99 ' The max level 

    Call PlayerMsg(Index, "You mine some copper.", C_WHITE)

    Call GiveItem(Index, 5, 1)' Change these

    MiningExp = MiningExp + 10

    If MiningExp => MiningTNL And MiningLevel < MaxMiningLevel Then

    MiningExp = MinningExp - MiningTNL

    MiningTNL = Int(MiningTNL * 1.4)

    MiningLevel = MiningLevel + 1

    Call PlayerMsg(Index,"You are now Mining Level "&MiningLevel&" !",C_BRIGHTCYAN)  

    End If

    Call Putvar("skillset.ini", ConvertToString(GetPlayerLogin(Index))&"_"&ConvertToString(GetPlayerName(Index)), "MiningLevel",""&MiningLevel)

    Call Putvar("skillset.ini", ConvertToString(GetPlayerLogin(Index))&"_"&ConvertToString(GetPlayerName(Index)), "MiningExp",""&MiningExp)

    Call Putvar("skillset.ini", ConvertToString(GetPlayerLogin(Index))&"_"&ConvertToString(GetPlayerName(Index)), "MiningTNL",""&MiningTNL)


End Sub

Put this under Select Case Parse

 Case "/mining"

MiningLevel=GetVar("skillset.ini", ConvertToString(GetPlayerLogin(Index))&"_"&ConvertToString(GetPlayerName(Index)), "MiningLevel")

         Call PlayerMsg(Index,"Your Mining Level is "&MiningLevel&" !",C_BRIGHTCYAN)

HTML Comment Box is loading comments...