local maidList = {} local autoblackList = {}; local ignoretype = 0; local tam = 3;-- we increase thrust level local autothrust = true;--increase thrust with all local currentChar; --[[ This function change the increase of affinity @arg _flag choose if the affinity should not increases true = yes, false = no if nil then yes and default value is false so the bot increase by default 2 times the affinity, if needed. @return nil @post change if the userfunction change the change affinity example: DoNotIncreaseAffinity(false) This will stop the auto increase of affinity ]]-- function DoNotIncreaseAffinity(_flag) if(notneed ~= nil)then autothrust =_flag else autothrust = true end end --[[ This function change the increase of affinity in the value @arg _value choose how many times the bot will talk to the maid if nil then yes and default value is false so the bot increase by default 2 times the affinity, if needed. @return nil @post change how much the userfunction try at max to increase the affinity example: ChangeIncreaseAffinity(2) This will change how many time try to change the affinity ]]-- function ChangeIncreaseAffinity(_value) tam = _value; end --[[ This function overwrites all use (as) of maids to the given value WARNINIG This function has a higher priority than SetMaidList(_table) @arg _value choose what do you want to talk the values goes from 2 to 6 like they are in the menu @return nil @post change how you use the housemaids example: OverWriteAllUse(2) This will get mage buffs from all housemaids you encounter ]]-- function OverWriteAllUse(_type) ignoretype = _type; end --[[ This function overwrites all use (as) of maids to the given value WARNINIG This function has a lower priority than the other functions @args _e.g SetMaidList({ {name = "My Housemaid",thrust = true, type = 2 }, @arg name Needed the find which you want @arg (optional)thrust Should affinity be increased values are true or false @arg ( optional)type Force type to given value,the values goes from 2 to 6 like they are in the menu @return nil @post change how you use the housemaids example: SetMaidList({ {name = "My Housemaid",thrust = true, type = 2 }, This will change the housemaid "My Housemaid" to be increased affinity and use for mage buffs ]]-- function SetMaidList(_table) local function checklist(_ltable) local errorcheck = false if type(_ltable) ~= "table" then errorcheck = true end for k,v in pairs(_ltable) do if type(v) ~= "table" then errorcheck = true break end if v.name == nil then errorcheck = true break end if errorcheck then break end end if errorcheck then error("SetMaidList(); Invalid argument.") end end checklist(_table) maidList = table.copy(_table) end --[[ This function use all Housemaids in range @return true if some was found false if not @post all housemaids will be used if possible example: AutoUseAllMaids() This will use all Housemaids ]]-- function AutoUseAllMaids() local foundone = false; local maid; local maidsInHouse = {}; if(currentChar == nil)then currentChar = player.Name; elseif(currentChar ~= player.Name) then currentChar = player.Name; currentMaid = nil; end local DBID, name, sex, character, month, day, horoscope, race, Affinity, AffinityMax, Charisma, CharismaMax, Fatigue, FatigueMax, Magic, MagicMax, Battle, BattleMax, Defense, DefenseMax, Cooking, CookingMax, Inventive, InventiveMax; local searchcounter = 1; repeat DBID, name, sex, character, month, day, horoscope, race, Affinity, AffinityMax, Charisma, CharismaMax, Fatigue, FatigueMax, Magic, MagicMax, Battle, BattleMax, Defense, DefenseMax, Cooking, CookingMax, Inventive, InventiveMax = RoMScript("Houses_GetServantInfo( "..searchcounter.." )"); searchcounter = searchcounter +1; if(name ~= nil)then table.insert(maidsInHouse , name); end until name == nil for k,currentName in pairs(maidsInHouse) do if(autoblackList[currentName] == nil )then if( player:target_NPC(currentName)) then printf("Found Housemaid") currentMaid = currentName if(UseMaid(currentName) ~= true) then return false; else if( currentName ~= nil)then autoblackList[currentName] = currentName; foundone = true; end end end end yrest(100); end return foundone end --[[ This function use a specific housemaid @arg _maidName The name of the Housemaid you want to use @return true if the housemaid was found false if not @post housemaid is used if possible example: UseMaid("Lili MacDonald") This will use the housemaid Lili MacDonald ]]-- function UseMaid(_maidName) local i = 1; local k = 1; local maidtype = 0; local _maid; local notneed = false; local helpflag = false; --local maidtype = _maid.type + 1; if( _maidName == nil)then printf("No housemaid specificed"); return false; end local function checkFatigue(ID) local DBID, name, sex, character, month, day, horoscope, race, Affinity, AffinityMax, Charisma, CharismaMax, Fatigue = RoMScript("Houses_GetServantInfo( "..ID.." )"); if( Fatigue >= 90)then return false; else return true; end end if (player:target_NPC(_maidName))then local DBID, name, sex, character, month, day, horoscope, race, Affinity, AffinityMax, Charisma, CharismaMax, Fatigue, FatigueMax, Magic, MagicMax, Battle, BattleMax, Defense, DefenseMax, Cooking, CookingMax, Inventive, InventiveMax; local searchcounter = 1; repeat DBID, name, sex, character, month, day, horoscope, race, Affinity, AffinityMax, Charisma, CharismaMax, Fatigue, FatigueMax, Magic, MagicMax, Battle, BattleMax, Defense, DefenseMax, Cooking, CookingMax, Inventive, InventiveMax = RoMScript("Houses_GetServantInfo( "..searchcounter.." )"); searchcounter = searchcounter +1; until name == _maidName local maidID = searchcounter -1; for k,v in pairs(maidList) do if(v.name == _maidName)then _maid = v; end end if( MagicMax == 100) then maidtype = 2; end printf("MagicMax is : ".. MagicMax .."\n"); printf("Magic is : ".. Magic .."\n"); if( BattleMax == 100) then maidtype = 3; end printf("BattleMax is : ".. BattleMax .."\n"); printf("Battle is : ".. Battle .."\n"); if( DefenseMax == 100) then maidtype = 4; end printf("DefenseMax is : ".. DefenseMax .."\n"); printf("Defense is : ".. Defense .."\n"); if( CookingMax == 100) then maidtype = 5; end printf("CookingMax is : ".. CookingMax .."\n"); printf("CookingM is : ".. Cooking .."\n"); if( InventiveMax == 100) then maidtype = 6; end printf("InventiveMax is : ".. InventiveMax .."\n"); printf("Inventive is : ".. Inventive .."\n"); if( Affinity == 100) then notneed = true; end if(_maid ~=nil and _maid.type ~= nil)then maidtype = _maid.type end if( ignoretype and ignoretype ~= 0 )then maidtype = ignoretype; end yrest(1000) printf("Using housemaid :".._maidName.." \n") if( _maid ~=nil and _maid.thrust ~= nil and _maid.thrust == true)then helpflag = true end if(( helpflag or autothrust) and not notneed)then while (i <= tam and checkFatigue(maidID)) do RoMScript("SpeakFrame_ListDialogOption(1,1)") yrest(500); player:target_NPC(_maidName) i = i + 1; yrest(500); end end if( notneed) then tam = 0; end while (k <= 5 and checkFatigue(maidID)) do RoMScript("SpeakFrame_ListDialogOption(1,"..maidtype..")") player:target_NPC(_maidName) k = k + 1; yrest(500); end tam = 3; RoMScript("CloseWindows()") return true; else printf("Housemaid not found :".._maid.name.." \n") RoMScript("CloseWindows()") return false; end RoMScript("CloseWindows()") end --[[ This function will open the bag of a specifc housemaid @arg _maidName The name of the Housemaid you want to use @return true if the housemaid was found false if not @post housemaid is used if possible @note this isn't finished it open only the bag nothing more example:openMaidBag("Lili MacDonald") This will open the bag of the housemaid Lili MacDonald ]]-- function openMaidBag(_maidName) if( _maidName == nil)then if(currentMaid == nil)then printf("No housemaid specificed \n"); return else _maidName = currentMaid; end end if (player:target_NPC(_maidName))then printf("Opening housemaid bag :".._maidName.."\n") RoMScript("SpeakFrame_ListDialogOption(1,7)") return true; else printf("Housemaid not found :".._maidName.."") return false; end end --[[ This function let the bot leave the house @return true if the housemaid was found false if not example:leaveHouse() We will leave the house ]]-- function leaveHouse() if( player:target_NPC(110758))then RoMScript("SpeakFrame_ListDialogOption(1,1)") waitForLoadingScreen(); else printf("Couldn't leave did not found housemaid \n"); end end --[[ This function clear all lists @post List are clear example:clearHouseMaidList ]]-- function clearHouseMaidList() currentMaid = nil; autoblackList = nil; end