Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 I have a script that activates when somebody clicks on an on-click tie. Here's my script for the OnClick Sub:```Case 1 Call quest1(index) Exit Sub```And here's my quest1 Sub:```If GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "Flag1") = 0 Then Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CHAT\Sedsew's Apple\Sedsew1.bmp", 1) Call RaiseFlag(index, 1, 1)End IfDo While slot < 25If GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "Flag1") = 1 ThenIf GetPlayerInvItemNum(index, int(slot)) = 1 Then Call TakeCurrency(index, 115, 1) Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CHAT\Sedsew's Apple\Sedsew2.bmp", 1) Call GiveCurrency(index, 107, 1) Call RaiseFlag(index, 1, 1)End IfEnd Ifslot = int(slot) +1loopIf GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "Flag1") = 2 ThenCall CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CHAT\Sedsew.bmp", 1)End If End Sub```When I click on the tile, I get an error saying: "Cannot use arguement "GetVar"" Well, something among those lines. Why is it doing this? Link to comment Share on other sites More sharing options...
AdrianC Posted December 24, 2008 Share Posted December 24, 2008 Did you create those .ini files initially? Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 Not sure what you mean by that, but I created the ini. Manually, so I didn't reset my character. Does it matter if I did? I can reset my character if required. Link to comment Share on other sites More sharing options...
AdrianC Posted December 24, 2008 Share Posted December 24, 2008 As long as you did it right, and entered within that .ini fille all the required information, then you don't have to do anything over there.You added the RaiseFlag sub at the bottom of main.txt, right?Also, I just thought about it, where did you get that error from? Like, actually ingame, or what? Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 Yup, the quest1 sub is at the bottom. The error is in-game, when you try to click on the OnClick tile which activates the quest1(index). Link to comment Share on other sites More sharing options...
AdrianC Posted December 24, 2008 Share Posted December 24, 2008 No, I'm not asking about the quest1 sub.There should be a RaiseFlag sub as well.Also, if you could tell me the exact error you're getting, it would help. Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 Wait the error is "Arguement Not Optional", that's the exact name. RaiseFalg sub? Never heard of it :embarrassed:. It didn't include that with the quest script… Link to comment Share on other sites More sharing options...
AdrianC Posted December 24, 2008 Share Posted December 24, 2008 RaiseFlag, as far as I know is not a valid command. You would need a RaiseFlag sub at the bottom of main.txt for that code to work. Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 Hmmmmmmmm, what if I just erase that and put in aCall PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "Flag1", 1)Let me try it =).*Edit*I'm still getting the same error, and I don't think it involves the RaiseFlag sub. Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 Ok here's my main.txt, if it'll help anyone:```' Eclipse Evolution 2.7 Scripting File' Global VariablesPublic GameNamePublic MAX_MAPSPublic MOTD' Color ConstantsPublic Const BLACK = 0Public Const BLUE = 1Public Const GREEN = 2Public Const CYAN = 3Public Const RED = 4Public Const MAGENTA = 5Public Const BROWN = 6Public Const GREY = 7Public Const DARKGREY = 8Public Const BRIGHTBLUE = 9Public Const BRIGHTGREEN = 10Public Const BRIGHTCYAN = 11Public Const BRIGHTRED = 12Public Const PINK = 13Public Const YELLOW = 14Public Const WHITE = 15' Admin ConstantsPublic Const ADMIN_MONITER = 1Public Const ADMIN_MAPPER = 2Public Const ADMIN_DEVELOPER = 3Public Const ADMIN_CREATOR = 4' Executes when the server initially loads.Sub OnServerLoad() GameName = GetVar("Data.ini", "CONFIG", "GameName") MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS") MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub' Executes every second, based on the server time.Sub TimedEvent(Hours, Minutes, Seconds) If Minutes = 0 Then If Seconds = 0 Then Call AdminMsg("Don't forget to vote for Eclipse.", GREEN) End If End IfEnd Sub' Executes when the scripts are reloaded.Sub OnScriptReload() GameName = GetVar("Data.ini", "CONFIG", "GameName") MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS") MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub' Executes the MOTD is changed by the client.Sub ChangeMOTD() MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub' Executes when a new character is created.Sub OnNewChar(Index, CharNum)End Sub' Executes when a player presses the CONTROL key.Sub OnAttack(Index, Damage) Dim Target Dim Range Range = Rand(Int(Damage) - 2, Int(Damage) + 2) If Int(Range) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, Range) Else Target = GetPlayerTargetNPC(Index) Call DamageNPC(Index, Target, Range) End If Else If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, 0) Else Target = GetPlayerTargetNPC(Index) Call DamageNPC(Index, Target, 0) End If End IfEnd SubSub OnArrowHit(Index, Damage) Dim Target Dim SpeedDmg SpeedDmg = Rand(Int(GetPlayerSpeed(Index) / 2) - 2, Int(GetPlayerSpeed(Index) / 2) + 2) If Int(SpeedDmg) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, SpeedDmg) Else Target = GetPlayerTargetNPC(Index) Call DamageNPC(Index, Target, SpeedDmg) End If Else If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, 0) Else Target = GetPlayerTargetNPC(Index) Call DamageNPC(Index, Target, 0) End If End IfEnd SubSub PlayerHit(Index, NPCNum, Damage) If Damage > 0 then Call NPCAttack(NPCNum, Index, Damage) End IfEnd Sub' Executes when a hotkey is pressed client-side.Sub HotScript(Index, KeyID) Select Case KeyID ' Executes when any player presses the PageUp key. Case 1 ' Executes when any player presses the Delete key. Case 2 ' Executes when players press the End key. Case 3 If GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "SITTING", "is_sitting") = "" Then Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "SITTING", "is_sitting", 1) If GetPlayerSprite(Index) = 0 Then Call SetPlayerSprite(Index, 27) ElseIf GetPlayerSprite(Index) = 12 Then Call SetPlayerSprite(Index, 28) ElseIf GetPlayerSprite(Index) = 17 Then Call SetPlayerSprite(Index, 29) ElseIf GetPlayerSprite(Index) = 20 Then Call SetPlayerSprite(Index, 30) End If Call LockPlayer(Index, 1) Call LockAttack(Index, 1) Call LockSpells(Index, 1) Call SetTimer("Sitting " & Index & "," & 5, 5000) Call SendPlayerData(Index) ElseIf GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "SITTING", "is_sitting") = 1 Then Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "SITTING", "is_sitting", "") If GetPlayerSprite(Index) = 27 Then Call SetPlayerSprite(Index, 0) ElseIf GetPlayerSprite(Index) = 28 Then Call SetPlayerSprite(Index, 12) ElseIf GetPlayerSprite(Index) = 29 Then Call SetPlayerSprite(Index, 17) ElseIf GetPlayerSprite(Index) = 30 Then Call SetPlayerSprite(Index, 20) End If Call LockPlayer(Index, 0) Call LockAttack(Index, 0) Call LockSpells(Index, 0) Call SendPlayerData(Index) End If ' Executes when players press the PageDown key. Case 4 End SelectEnd Sub' Executes when something on a custom menu is clicked.Sub MenuScripts(Index, Clicked_Index, Menu_Type) Dim MenuTitle Dim FieldMessage MenuTitle = getplayermenuclicktitle(Index) FieldMessage = getplayermenuclickmsg(Index) Select Case Menu_Type Case 1 Call PlayerMsg(Index, "Clicked picture number " & Clicked_Index & " on the menu named " & MenuTitle, YELLOW) Case 2 Call PlayerMsg(Index, "Clicked field number " & Clicked_Index & " on the menu named " & MenuTitle & ". The field text was " & FieldMessage, YELLOW) Case 3 Call PlayerMsg(Index, "Clicked label number " & Clicked_Index & " on the menu named " & MenuTitle, YELLOW) End SelectEnd Sub' Executes when a player logs into the game.Sub JoinGame(Index) If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has joined " & GameName & "!", GREEN) End If If GetPlayerAccess(Index) = 1 Then Call GlobalMsg("Moderator " & GetPlayerName(Index) & " has joined " & GameName & "!", GREEN) End If If GetPlayerAccess(Index) = 2 Then Call GlobalMsg("Mapper " & GetPlayerName(Index) & " has joined " & GameName & "!", GREEN) End If If GetPlayerAccess(Index) = 3 Then Call GlobalMsg("Developer " & GetPlayerName(Index) & " has joined " & GameName & "!", GREEN) End If If GetPlayerAccess(Index) = 4 Then Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has joined " & GameName & "!", GREEN) End If If GetPlayerAccess(Index) = 5 Then Call GlobalMsg("Game Owner " & GetPlayerName(Index) & " has joined " & GameName & "!", GREEN) End If Call PlayerMsg(Index, "Welcome to " & GameName & "!", GREEN) If LenB(MOTD) <> 0 Then Call PlayerMsg(Index, "MOTD: " & MOTD, GREEN) End If Call SendWhosOnline(Index)End Sub' Executes when a player logs out of the game.Sub LeftGame(Index) If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has left " & GameName & "!", GREEN) End If If GetPlayerAccess(Index) = 1 Then Call GlobalMsg("Moderator " & GetPlayerName(Index) & " has left " & GameName & "!", GREEN) End If If GetPlayerAccess(Index) = 2 Then Call GlobalMsg("Mapper " & GetPlayerName(Index) & " has left " & GameName & "!", GREEN) End If If GetPlayerAccess(Index) = 3 Then Call GlobalMsg("Developer " & GetPlayerName(Index) & " has left " & GameName & "!", GREEN) End If If GetPlayerAccess(Index) = 4 Then Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has left " & GameName & "!", GREEN) End If If GetPlayerAccess(Index) = 5 Then Call GlobalMsg("Game Owner " & GetPlayerName(Index) & " has left " & GameName & "!", GREEN) End If If GetVar("Buff.ini", GetPlayerName(index), "0") <> "" Then Call Debuff(index, "0") End If If GetVar("Buff.ini", GetPlayerName(index), "1") <> "" Then Call Debuff(index, "1") End If If GetVar("Buff.ini", GetPlayerName(index), "2") <> "" Then Call Debuff(index, "2") End If If GetVar("Buff.ini", GetPlayerName(index), "3") <> "" Then Call Debuff(index, "3") End IfEnd Sub' Executes when a players experience exceeds the next level requirement.Sub PlayerLevelUp(Index) Dim TotalExp Do While GetPlayerExp(Index) >= GetPlayerNextLevel(Index) TotalExp = GetPlayerExp(Index) - GetPlayerNextLevel(Index) Call SetPlayerLevel(Index, GetPlayerLevel(Index) + 1) Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + 1) Call SetPlayerExp(Index, TotalExp) Loop Call BattleMsg(Index, "You now have " & GetPlayerPOINTS(Index) & " Stat Points.", GREEN, 0)End Sub' Executes when a player uses one of the points given on an attribute to level up.Sub UsingStatPoints(Index, PointType) Select Case PointType Case 0 If GetPlayerSTR(Index) + 1 > 1000 Then Call BattleMsg(Index, "You have maxed your strength!", GREEN, 0) Exit Sub End If Call SetPlayerSTR(Index, GetPlayerSTR(Index) + 1) Call BattleMsg(Index, "You have grown more strong!", GREEN, 0) Case 1 If GetPlayerDEF(Index) + 1 > 1000 Then Call BattleMsg(Index, "You have maxed your defence!", GREEN, 0) Exit Sub End If Call SetPlayerDEF(Index, GetPlayerDEF(Index) + 1) Call BattleMsg(Index, "You have gained more defense!", GREEN, 0) Case 2 If GetPlayerMAGI(Index) + 1 > 1000 Then Call BattleMsg(Index, "You have maxed your magic!", GREEN, 0) Exit Sub End If Call SetPlayerMAGI(Index, GetPlayerMAGI(Index) + 1) Call BattleMsg(Index, "You have become more intelligent in the magical arts!", GREEN, 0) Case 3 If GetPlayerSPEED(Index) + 1 > 1000 Then Call BattleMsg(Index, "You have maxed your speed!", GREEN, 0) Exit Sub End If Call SetPlayerSPEED(Index, GetPlayerSPEED(Index) + 1) Call BattleMsg(Index, "You have gained better dexterity!", GREEN, 0) End Select ' Remove one point after the sub in question is done Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) - 1)End Sub' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", GREEN) Exit Sub Case 1 If GetPlayerSprite(Index) = 0 Then Call SetPlayerSprite(Index, 25) ElseIf GetPlayerSprite(Index) = 12 Then Call SetPlayerSprite(Index, 31) ElseIf GetPlayerSprite(Index) = 17 Then Call SetPlayerSprite(Index, 32) ElseIf GetPlayerSprite(Index) = 20 Then Call SetPlayerSprite(Index, 33) End If Call SendPlayerData(Index) Case 2 If GetPlayerSprite(Index) = 25 Then Call SetPlayerSprite(Index, 0) ElseIf GetPlayerSprite(Index) = 31 Then Call SetPlayerSprite(Index, 12) ElseIf GetPlayerSprite(Index) = 32 Then Call SetPlayerSprite(Index, 17) ElseIf GetPlayerSprite(Index) = 33 Then Call SetPlayerSprite(Index, 20) End If Call SendPlayerData(Index) Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", GREEN) Exit Sub End SelectEnd Sub' Executes when a player clicks on an OnClick tile.Sub OnClick(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", GREEN) Exit Sub Case 1 Call quest1(index) Exit Sub Case 2 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CHAT\Talrok.bmp", 1) Exit Sub Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", GREEN) Exit Sub End SelectEnd Sub' Out-dated: Executes when a player chooses yes or no on a player prompt.Sub PlayerPrompt(Index, Prompt, Value) If Prompt = 6 Then Select Case Value Case 0 Call GlobalMsg("Hi This is a Yes answer!", GREEN) Case 1 Call GlobalMsg("This is case 1?", GREEN) End Select Else Select Case Value Case 0 Call GlobalMsg("Hi This is a No answer!", GREEN) Case 1 Call GlobalMsg("This is no case 1?", GREEN) End Select End IfEnd Sub' Out-dated: Executes query box responses.Sub QueryBox(Index, Prompt) Value = GetVar("responses.ini", "Responses", CStr(Index))End Sub' Executes every time a player drops an item.Sub OnItemDrop(Index, Map, ItemNum, ItemVal, ItemDur, ItemIndex, InvSlot)End Sub' Executes each time a player changes map.Sub OnMapLoad(Index, OldMap, NewMap)End Sub' Executes whenever an NPC is killed.' Note: Death occurs as normal externally to this script.Sub OnNPCDeath(Index, Map, NPCNum, NPCIndex) Call BattleMsg(Index, "You killed a " & getnpcname(NPCNum) & ".", GREEN, 0)End Sub' Executes when a player is killed by another.' Note: Death occurs as normal externally to this script.Sub OnPVPDeath(Attacker, Victim) Call GlobalMsg(GetPlayerName(Victim) & " has been killed by " & GetPlayerName(Attacker), GREEN)End Sub' Executes when a player dies in an arena by another player.Sub OnArenaDeath(Attacker, Victim) Dim Map Dim X Dim Y Dim Data1 Dim Data2 Dim Data3 Map = GetPlayerMap(Victim) X = GetPlayerX(Victim) Y = GetPlayerY(Victim) Call GlobalMsg(GetPlayerName(Victim) & " has been defeated in the arena by " & GetPlayerName(Attacker), GREEN) Call SetPlayerHP(Victim, GetPlayerMaXHP(Victim)) Call SetPlayerMP(Victim, GetPlayerMaXMP(Victim)) Call sendHp(Victim) Call sendMP(Victim) Data1 = GetTileData1(Map, X, Y) Data2 = GetTileData2(Map, X, Y) Data3 = GetTileData3(Map, X, Y) Call PlayerWarp(Victim, Data1, Data2, Data3)End Sub' Executes whenever a player casts a scripted spell.Sub ScriptedSpell(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted spell has no apparent use.", GREEN) Exit Sub Case 1 If GetPlayerTarget(index) > 0 Then Call Buff(GetPlayerTarget(index), 0, 5, 10) End If Case Else Call PlayerMsg(Index, "No spell script found. Please contact an admin to solve this problem.", GREEN) Exit Sub End SelectEnd Sub' Executes whenever a scripted NPC does an action.Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted NPC has no apparent use.", GREEN) Exit Sub Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", GREEN) Exit Sub End SelectEnd Sub' Executed whenever a slash command is sent to the server.Sub Commands(Index) Dim TextSay Dim PlayerID Dim MapNum ' Get the command and arguments from the cache. TextSay = Trim(GetVar("Scripts\Command.ini", "TEMP", "Text" & Index)) ' Split the command into an array. All arguments are seperated by spaces. TextSay = Split(TextSay) Select Case TextSay(0) Case "/testscripts" Call TestMain(Index) Exit Sub Case "/help" Call PlayerMsg(Index, "Social Commands:", GREEN) Call PlayerMsg(Index, "'msghere = Broadcast Message", GREEN) Call PlayerMsg(Index, "-msghere = Emote Message", GREEN) Call PlayerMsg(Index, "!namehere msghere = Player Message", GREEN) Call PlayerMsg(Index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh", GREEN) Exit Sub Case "/calladmins" If GetPlayerAccess(Index) = 0 Then Call AdminMsg(GetPlayerName(Index) & " needs your help!", GREEN) Else Call PlayerMsg(Index, "You are an admin! You cannot call for help!", GREEN) End If Exit Sub Case "/admin" If GetPlayerAccess(Index) > 0 Then Call PlayerMsg(Index, "Social Commands:", GREEN) Call PlayerMsg(Index, """msghere = Global Admin Message", GREEN) Call PlayerMsg(Index, "=msghere = Private Admin Message", GREEN) Call PlayerMsg(Index, "Available Commands: /admin, /loc, /mapeditor, /warpmeto, /warptome, /warpto, /setsprite, /mapreport, /kick, /ban, /edititem, /respawn, /editnpc, /motd, /editshop, /ban, /editspell", GREEN) End If Exit Sub Case "/warpmeto" If GetPlayerAccess(Index) > 0 Then PlayerID = FindPlayer(TextSay(1)) If PlayerID > 0 Then Call PlayerWarp(Index, GetPlayerMap(PlayerID), GetPlayerX(PlayerID), GetPlayerY(PlayerID)) Call PlayerMsg(Index, "You have been warped to " & GetPlayerName(PlayerID) & ".", GREEN) Else Call PlayerMsg(Index, "Player is not online.", GREEN) End If End If Exit Sub Case "/warptome" If GetPlayerAccess(Index) > 0 Then PlayerID = FindPlayer(TextSay(1)) If PlayerID > 0 Then Call PlayerWarp(PlayerID, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index)) Call PlayerMsg(PlayerID, "You have been warped to " & GetPlayerName(Index) & ".", GREEN) Else Call PlayerMsg(Index, "Player is not online.", GREEN) End If End If Exit Sub Case "/warpto" If GetPlayerAccess(Index) > 0 Then MapNum = TextSay(1) If MapNum > 0 And MapNum <= MAX_MAPS Then Call PlayerWarp(Index, MapNum, GetPlayerX(Index), GetPlayerY(Index)) Call PlayerMsg(Index, "You have been warped to map #" & MapNum & ".", GREEN) Else Call PlayerMsg(Index, "Invalid map number.", GREEN) End If End If Exit Sub End Select Call PlayerMsg(Index, "That is not a valid command.", GREEN)End Sub' Executes on death, dropping all of the players items.Sub DropItems(Index) ' Remove this to enable. Exit Sub If GetPlayerWeaponSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerWeaponSlot(Index), 0) End If If GetPlayerArmorSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerArmorSlot(Index), 0) End If If GetPlayerHelmetSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerHelmetSlot(Index), 0) End If If GetPlayerShieldSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerShieldSlot(Index), 0) End If If GetPlayerLegsSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerLegsSlot(Index), 0) End If If GetPlayerRingSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerRingSlot(Index), 0) End If If GetPlayerNecklaceSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerNecklaceSlot(Index), 0) End IfEnd Sub' Executes whenever somebody dies outside of an arena.Sub OnDeath(Index) Dim MapNum Dim ClassID Dim X Dim Y If GetMapBootMap(Index) > 0 Then Call PlayerWarp(Index, GetMapBootMap(Index), GetMapBootX(Index), GetMapBootY(Index)) Else ClassID = GetPlayerClass(Index) MapNum = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "Map") X = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "x") Y = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "y") Call PlayerWarp(Index, MapNum, X, Y) End IfEnd Sub' Executes whenever a scripted item is used or double clicked.Sub ScriptedItem(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted item has no apparent use.", WHITE) Exit Sub Case 1 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Angry Fuzzy.bmp", 1) Exit Sub Case 2 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Angry Slyme.bmp", 1) Exit Sub Case 3 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Bolt.bmp", 1) Exit Sub Case 4 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Dark Knight.bmp", 1) Exit Sub Case 5 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Elena.bmp", 1) Exit Sub Case 6 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Evil Slyme.bmp", 1) Exit Sub Case 7 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Flyng Sword.bmp", 1) Exit Sub Case 8 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Fuzzy.bmp", 1) Exit Sub Case 9 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Heaven Guard.bmp", 1) Exit Sub Case 10 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Heaven Squiddle.bmp", 1) Exit Sub Case 11 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Kitten Slime.bmp", 1) Exit Sub Case 12 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Sedsew.bmp", 1) Exit Sub Case 13 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Shell Squiddle.bmp", 1) Exit Sub Case 14 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Slime Squiddle.bmp", 1) Exit Sub Case 15 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Slimey.bmp", 1) Exit Sub Case 16 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Slyme.bmp", 1) Exit Sub Case 17 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Talrok.bmp", 1) Exit Sub Case 18 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Target.bmp", 1) Exit Sub Case 19 Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CARDS\Zombie Squiddle.bmp", 1) Exit Sub Case Else Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", GREEN) Exit Sub End SelectEnd Sub' Map AttributesSub SetBlank(Map, X, Y) Call SetAttribute(Map, X, Y, 0, 0, 0, 0, "", "", "")End SubSub SetBlock(Map, X, Y) Call SetAttribute(Map, X, Y, 1, 0, 0, 0, "", "", "")End SubSub SetWarp(Map, X, Y, WarpMap, WarpX, WarpY) Call SetAttribute(Map, X, Y, 2, WarpMap, WarpX, WarpY, "", "", "")End SubSub SetItem(Map, X, Y, ItemID, ItemValue) Call SetAttribute(Map, X, Y, 3, ItemID, ItemValue, 0, "", "", "")End SubSub SetNPCAvoid(Map, X, Y) Call SetAttribute(Map, X, Y, 4, 0, 0, 0, "", "", "")End SubSub SetKeY(Map, X, Y, KeyID, KeyTake) Call SetAttribute(Map, X, Y, 5, KeyID, KeyTake, 0, "", "", "")End SubSub SetKeYOpen(Map, X, Y, KeyX, KeyY, Message) Call SetAttribute(Map, X, Y, 6, KeyX, KeyY, 0, Message, "", "")End SubSub SetHeal(Map, X, Y) Call SetAttribute(Map, X, Y, 7, 0, 0, 0, "", "", "")End SubSub SetKill(Map, X, Y) Call SetAttribute(Map, X, Y, 8, 0, 0, 0, "", "", "")End SubSub SetShop(Map, X, Y, ShopID) Call SetAttribute(Map, X, Y, 9, ShopID, 0, 0, "", "", "")End SubSub SetClassBlock(Map, X, Y, Allow1, Allow2, Allow3) Call SetAttribute(Map, X, Y, 10, Allow, Allow2, Allow3, "", "", "")End SubSub SetArena(Map, X, Y, MapID, NewX, NewY) Call SetAttribute(Map, X, Y, 11, MapID, NewX, NewY, "", "", "")End SubSub SetSound(Map, X, Y, FileName) Call SetAttribute(Map, X, Y, 12, 0, 0, 0, FileName, "", "")End SubSub SetSpriteChange(Map, X, Y, SpriteID, ItemID, Cost) Call SetAttribute(Map, X, Y, 13, SpriteID, ItemID, Cost, "", "", "")End SubSub SetSign(Map, X, Y, Line1, Line2, Line3) Call SetAttribute(Map, X, Y, 14, 0, 0, 0, Line1, Line2, Line3)End SubSub SetDoor(Map, X, Y) Call SetAttribute(Map, X, Y, 15, 0, 0, 0, "", "", "")End SubSub SetNotice(Map, X, Y, Title, Text, FileName) Call SetAttribute(Map, X, Y, 16, 0, 0, 0, Title, Text, FileName)End SubSub SetScripted(Map, X, Y, Script) Call SetAttribute(Map, X, Y, 18, Script, 0, 0, "", "", "")End SubSub SetBank(Map, X, Y) Call SetAttribute(Map, X, Y, 23, 0, 0, 0, "", "", "")End Sub' Tests scripts up to the location of Sub TestMain(Index).' Leave this sub at the bottom to test the entire script file.Sub TestMain(Index) Call PlayerMsg(Index, "Scripts are working properly.", BRIGHTGREEN)End SubSub Sitting(Index, Amount)Call RemoveTimer("Sitting " & Index & "," & Amount) If GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "SITTING", "is_sitting") = 1 Then If GetPlayerHP(Index) = GetPlayerMaxHP(Index) Then Call BattleMsg(Index, "Your HP is fully restored!", 14, 0) Exit Sub Else Call SetPlayerHP(Index, GetPlayerHP(Index) + Amount) Call BattleMsg(Index, "You have restored +" & Amount & " HP!", 14, 0) Call SetTimer("Sitting " & Index & "," & Amount, 5000) End IfEnd If Call SendHP(Index)End SubSub Buff(index, stat, amount, duration) If GetVar("Buff.ini", GetPlayerName(index), CStr(stat)) = "" Then Select Case stat Case 0 Call SetPlayerStr(index, GetPlayerStr(index) + Int(Amount)) Case 1 Call SetPlayerDef(index, GetPlayerDef(index) + Int(Amount)) Case 2 Call SetPlayerMagi(index, GetPlayerMagi(index) + Int(Amount)) Case 3 Call SetPlayerSpeed(index, GetPlayerSpeed(index) + Int(Amount)) Case Else Exit Sub End Select Call SendStats(index) Call PutVar("Buff.ini", GetPlayerName(index), CStr(stat), Cstr(amount)) duration = duration * 1000 Call SetTimer("Debuff " & index & ", " & CStr(stat), duration) Call SendHP(index) Call SendMP(index) Call SendSP(index) End IfEnd SubSub Debuff(index, stat)Amount = GetVar("Buff.ini", GetPlayerName(index), CStr(stat)) Select Case stat Case "0" Call SetPlayerStr(index, GetPlayerStr(index) - Int(Amount)) Case "1" Call SetPlayerDef(index, GetPlayerDef(index) - Int(Amount)) Case "2" Call SetPlayerMagi(index, GetPlayerMagi(index) - Int(Amount)) Case "3" Call SetPlayerSpeed(index, GetPlayerSpeed(index) - Int(Amount)) End SelectCall SendStats(index)Call PutVar("Buff.ini", GetPlayerName(index), CStr(stat), "")Call RemoveTimer("Debuff " & index & ", " & CStr(stat))Call SendHP(index)Call SendMP(index)Call SendSP(index)End SubSub OnClickPlayer(Index) Call CustomMenuShow(index, "Player Profile", "\GUI\CUSTOM\PlayerProfile.gif", 1) Call CustomMenuLabel(index, 1, "Player : " & GetTargetName(index), 150, 50, 10, 0, 0, 400, 20) Call CustomMenuLabel(index, 2, "Level : " & GetTargetLevel(index), 20, 100, 10, 0, 0, 400, 20) Call CustomMenuLabel(index, 3, "Job : " & GetTargetJob(index), 20, 120, 10, 0, 0, 400, 20) Call CustomMenuLabel(index, 4, "Guild : " & GetTargetGuild(index), 20, 140, 10, 0, 0, 400, 20) Call CustomMenuLabel(index, 5, "STR : " & GetTargetStr(index), 20, 160, 10, 0, 0, 400, 20) Call CustomMenuLabel(index, 6, "DEF : " & GetTargetDef(index), 20, 180, 10, 0, 0, 400, 20) Call CustomMenuLabel(index, 7, "MAGI : " & GetTargetMagi(index), 20, 200, 10, 0, 0, 400, 20) Call CustomMenuLabel(index, 8, "SPEED : " & GetTargetSpeed(index), 20, 220, 10, 0, 0, 400, 20)End Subsub quest1(index)dim slotslot = 1If GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "Flag1") = 0 Then Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CHAT\Sedsew's Apple\Sedsew1.bmp", 1) Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "Flag1", 1)End IfDo While slot < 25If GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "Flag1") = 1 ThenIf GetPlayerInvItemNum(index, int(slot)) = 1 Then Call TakeCurrency(index, 115, 1) Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CHAT\Sedsew's Apple\Sedsew2.bmp", 1) Call GiveCurrency(index, 107, 1) Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "Flag1", 2)End IfEnd Ifslot = int(slot) +1loopIf GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "Flag1") = 2 ThenCall CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CHAT\Sedsew.bmp", 1)End If End Sub``` Link to comment Share on other sites More sharing options...
AdrianC Posted December 24, 2008 Share Posted December 24, 2008 So did you get the sitting script to work?If not, they might screw each other.I don't really want to go into a deep analysis of your main.txt right now, I hate debugging. Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 Well, no, but I can fix it easily. I'll try it =). Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 Nah, it's still broken =/. Link to comment Share on other sites More sharing options...
AdrianC Posted December 24, 2008 Share Posted December 24, 2008 Lol, I dunno, I started looking through it and I'm like, damn debugging sux.Are you a beginner scripter? Start with easier scripts, and then code your own stuff from scratch. Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 Well, I'm experienced with Game Maker scripting, and I really just cut and paste lines from different codes to get this quest script. There's not very much simpler things to do, as everything I try in Sadscript gives me an error XD. Link to comment Share on other sites More sharing options...
balliztik1 Posted December 24, 2008 Share Posted December 24, 2008 Children, children."Argument not Optional" means that you left a parameter off. You only have 2 parameters in GetVar, instead of the required 3\. The first is the path, the second is the header, and the third is the variable. In PutVar, there are 4: the same 3, plus a value variable. Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 Thank you Balliztik =). You solved that problem, but now I get: "Type mismatch: TakeCurrency" Well, actually I changed the apples to an item, not a currency, and changed it to TakeItem, but now I'm getting: "Type mismatch: TakeItem" Link to comment Share on other sites More sharing options...
AdrianC Posted December 24, 2008 Share Posted December 24, 2008 Add this to the bottom of main.txtSub TakeItem(index, item, value)If value = "all" ThenSLOT = 1Do While SLOT < 25If GetPlayerInvItemNum(index, SLOT) = item ThenCall SetPlayerInvItemNum(index, SLOT, 0)Call SetPlayerInvItemValue(index, SLOT, 0)Call SendInventoryUpdate(index, SLOT)SLOT = 25End IfSLOT = SLOT+1LoopElseSLOT = 1Do While SLOT < 25If GetPlayerInvItemNum(index, SLOT) = item ThenCall SetPlayerInvItemNum(index, SLOT, 0)Call SetPlayerInvItemValue(index, SLOT, GetPlayerInvItemValue(index, SLOT) - value)Call SendInventoryUpdate(index, SLOT)SLOT = 25End IfSLOT = SLOT+1LoopEnd IfEnd SubI told you, you're starting with advanced stuff, you should go easy first. Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 Heh I almost have it XD. I just need one for Sub GiveItem, then I think it will work ^.^. I'm actually a good scripter, just never used this programm. I understand every line of this code, so don't worry about me =). I just need some subs to add. Link to comment Share on other sites More sharing options...
AdrianC Posted December 24, 2008 Share Posted December 24, 2008 You need to use GivePlayerItem, not give item. Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 What variables follow that? Is it (index), item, amount? Because it's giving me the "Arguement not optional". Yes, I need to fix this, I'm wasting all of my Squi Coins on these stupid apples. Curse you Sedsew and your love of apples! Link to comment Share on other sites More sharing options...
AdrianC Posted December 24, 2008 Share Posted December 24, 2008 Why don't you check the all commands thread? ;) Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 Never knew there was such a thing XD. Let me search for it… Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 Ok I found it nd now my quest script works, I just have one more tiny problem and then that's it! Well, I have 2 display screens, one is supposed to show when you give the NPC an item, and the other shows aytime you talk to him AFTER you give him the item and see the first screen. I have a problem though. It shows the first screen, then half a second later it replaces it with the second display screen. I thin it's the order that I put the code in, but here it is anyways:```sub quest1(index)dim slotslot = 1If GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "QUESTS", "Flag1") = 0 Then Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CHAT\Sedsew's Apple\Sedsew1.bmp", 1) Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "QUESTS", "Flag1", 1)End IfDo While slot < 25If GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "QUESTS", "Flag1") = 1 ThenIf GetPlayerInvItemNum(index, int(slot)) = 115 Then Call TakeItem(index, 115, 1) Call CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CHAT\Sedsew's Apple\Sedsew2.bmp", 1) Call GivePlayerItem(index, 107, 1, 0) Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "QUESTS", "Flag1", 2)End If End Ifslot = int(slot) +1loopIf GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "QUESTS", "Flag1") = 2 ThenCall CustomMenuShow(index, "chatbox_" & GetPlayerMap(Index), "\GUI\CUSTOM\CHAT\Sedsew.bmp", 1)End If End Sub```As you can see, I show the screen and raise the flag, but then it acts as if I had talked to the NPC again and the third screen shows up. half a second later. Is there a way to record if you close the second screen, and THEN it raises the flag? Link to comment Share on other sites More sharing options...
Squiddle Posted December 24, 2008 Author Share Posted December 24, 2008 Scratch that I fixed it myself ^.^. I have a working quest script now, woot! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now