Merchant Posted July 1, 2009 Author Share Posted July 1, 2009 Remember that code script you made me. If I wanted it so that I could manually change the .ini file that the script made, would I get rid of the bit that makes a new .ini file on server load? Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 1, 2009 Share Posted July 1, 2009 Could you link me to the script?I kinda make about 20-100 scripts a month, I usually don't remember what I make XD Link to comment Share on other sites More sharing options...
emblem Posted July 1, 2009 Share Posted July 1, 2009 [This it?](http://www.touchofdeathforums.com/smf/index.php/topic,46741.msg476180.html#msg476180) Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 1, 2009 Share Posted July 1, 2009 Oh, I see what he means.The system is quite automated, what exactly do you want to change in the inis? Lock it for some codes, or? Link to comment Share on other sites More sharing options...
Merchant Posted July 1, 2009 Author Share Posted July 1, 2009 I want to make each code only usable once. So when I see in the .ini the value is 1, ill set it to 0 and change the code. Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 1, 2009 Share Posted July 1, 2009 @Merchant:> I want to make each code only usable once. So when I see in the .ini the value is 1, ill set it to 0 and change the code.It's already only usable once, and you reset them all via reloading the server.But you can also manually edit them individually if you want, doesn't matter; just open that ini, and if you see a "1", set it to "0", then change the code for that certain one within the Case. Link to comment Share on other sites More sharing options...
Merchant Posted July 2, 2009 Author Share Posted July 2, 2009 I want to make it so that the script doesn't automatically set them to 0 on server load. Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 2, 2009 Share Posted July 2, 2009 @Merchant:> I want to make it so that the script doesn't automatically set them to 0 on server load.Then just take it out of serverload; put it in a hotkey or something, e.g.:Case 1 If GetPlayerAccess(Index) >=4 Then   For i = 0 To 3    Call PutVar("ItemCodes.ini", "CODES", "Code" & i, 0)   Next End If Exit SubThen, you press "Page Up" or whatever case 1 is, in the hotscript sub, and it will load/reload the inis. Link to comment Share on other sites More sharing options...
Merchant Posted July 3, 2009 Author Share Posted July 3, 2009 Ok great! Link to comment Share on other sites More sharing options...
Merchant Posted July 12, 2009 Author Share Posted July 12, 2009 The script still isn't working, when I put it in, all the commands stop working! Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 12, 2009 Share Posted July 12, 2009 Like, slash-commands (e.g. "/warptome")?Can you post your HotKey sub (or your Commands sub, if that's where you put it)? Link to comment Share on other sites More sharing options...
Merchant Posted July 12, 2009 Author Share Posted July 12, 2009 ``` Select Case TextSay(0)  Case "/code"       Dim Code      Code = TextSay(1)      Select Case Code      Case "12345"       If GetVar("ItemCodes.ini, "CODES", "Code0") = 0 Then          Call GiveCurrency(Index, 2, 500)          Call PutVar("ItemCodes.ini", "CODES'", "Code0", 1)       Else          Call PlayerMsg(Index, "I'm sorry,that code has already been used!", RED)       End If       Case "01493"       If GetVar("ItemCodes.ini, "CODES", "Code1") = 0 Then          Call GiveCurrency(Index, 2, 500)          Call PutVar("ItemCodes.ini", "CODES'", "Code1", 1)       Else          Call PlayerMsg(Index, "I'm sorry,that code has already been used!", RED)       End If       Case "90210"       If GetVar("ItemCodes.ini, "CODES", "Code2") = 0 Then         Call GiveCurrency(Index, 2, 500)          Call PutVar("ItemCodes.ini", "CODES'", "Code2", 1)    Else             Call PlayerMsg(Index, "I'm sorry,that code has already been used!", RED)          End If        Case Else       Call PlayerMsg(Index, "That is not a valid code!", BRIGHTRED)     End Select     Exit Sub Case "/testscripts" Call TestMain(Index) Exit Sub Case "/help" Call PlayerMsg(Index, "Social Commands:", WHITE) Call PlayerMsg(Index, "'msghere = Broadcast Message", WHITE) Call PlayerMsg(Index, "-msghere = Emote Message", WHITE) Call PlayerMsg(Index, "!namehere msghere = Player Message", WHITE) Call PlayerMsg(Index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh", WHITE) Exit Sub Case "/calladmins" If GetPlayerAccess(Index) = 0 Then Call AdminMsg(GetPlayerName(Index) & " needs your help!", BRIGHTGREEN) Else Call PlayerMsg(Index, "You are an admin! You cannot call for help!", BRIGHTGREEN) End If Exit Sub Case "/admin" If GetPlayerAccess(Index) > 0 Then Call PlayerMsg(Index, "Social Commands:", WHITE) Call PlayerMsg(Index, """msghere = Global Admin Message", WHITE) Call PlayerMsg(Index, "=msghere = Private Admin Message", WHITE) Call PlayerMsg(Index, "Available Commands: /admin, /loc, /mapeditor, /warpmeto, /warptome, /warpto, /setsprite, /mapreport, /kick, /ban, /edititem, /respawn, /editnpc, /motd, /editshop, /ban, /editspell", WHITE) 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) & ".", BROWN) Else Call PlayerMsg(Index, "Player is not online.", WHITE) 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) & ".", BROWN) Else Call PlayerMsg(Index, "Player is not online.", WHITE) 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 & ".", BRIGHTBLUE) Else Call PlayerMsg(Index, "Invalid map number.", BRIGHTRED) End If End If Exit Sub End Select Call PlayerMsg(Index, "That is not a valid command.", BRIGHTRED)End Sub``` Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 12, 2009 Share Posted July 12, 2009 Please use code tags next time, as just pasting it looses formatting as well as stretches the forums.Anyway, try this:``` Select Case TextSay(0)    Case "/code"       Dim Code       Code = TextSay(1)       Select Case Code       Case "12345"        If GetVar("ItemCodes.ini", "CODES", "Code0") = 0 Then            Call GiveCurrency(Index, 2, 500)            Call PutVar("ItemCodes.ini", "CODES'", "Code0", 1)         Else            Call PlayerMsg(Index, "I'm sorry,that code has already been used!", RED)         End If       Case "01493"         If GetVar("ItemCodes.ini", "CODES", "Code1") = 0 Then            Call GiveCurrency(Index, 2, 500)            Call PutVar("ItemCodes.ini", "CODES'", "Code1", 1)         Else           Call PlayerMsg(Index, "I'm sorry,that code has already been used!", RED)         End If       Case "90210"         If GetVar("ItemCodes.ini", "CODES", "Code2") = 0 Then             Call GiveCurrency(Index, 2, 500)            Call PutVar("ItemCodes.ini", "CODES'", "Code2", 1)      Else               Call PlayerMsg(Index, "I'm sorry,that code has already been used!", RED)            End If         Case Else          Call PlayerMsg(Index, "That is not a valid code!", BRIGHTRED)     End Select     Exit Sub   Case "/testscripts"    Call TestMain(Index)    Exit Sub   Case "/help"    Call PlayerMsg(Index, "Social Commands:", WHITE)    Call PlayerMsg(Index, "'msghere = Broadcast Message", WHITE)    Call PlayerMsg(Index, "-msghere = Emote Message", WHITE)    Call PlayerMsg(Index, "!namehere msghere = Player Message", WHITE)    Call PlayerMsg(Index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh", WHITE)    Exit Sub    Case "/calladmins"    If GetPlayerAccess(Index) = 0 Then      Call AdminMsg(GetPlayerName(Index) & " needs your help!", BRIGHTGREEN)    Else      Call PlayerMsg(Index, "You are an admin! You cannot call for help!", BRIGHTGREEN)    End If    Exit Sub    Case "/admin"    If GetPlayerAccess(Index) > 0 Then      Call PlayerMsg(Index, "Social Commands:", WHITE)      Call PlayerMsg(Index, """msghere = Global Admin Message", WHITE)      Call PlayerMsg(Index, "=msghere = Private Admin Message", WHITE)      Call PlayerMsg(Index, "Available Commands: /admin, /loc, /mapeditor, /warpmeto, /warptome, /warpto, /setsprite, /mapreport, /kick, /ban, /edititem, /respawn, /editnpc, /motd, /editshop, /ban, /editspell", WHITE)    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) & ".", BROWN)      Else       Call PlayerMsg(Index, "Player is not online.", WHITE)      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) & ".", BROWN)      Else       Call PlayerMsg(Index, "Player is not online.", WHITE)      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 & ".", BRIGHTBLUE)      Else       Call PlayerMsg(Index, "Invalid map number.", BRIGHTRED)      End If    End If    Exit Sub End Select Call PlayerMsg(Index, "That is not a valid command.", BRIGHTRED)End Sub``` Link to comment Share on other sites More sharing options...
Merchant Posted July 12, 2009 Author Share Posted July 12, 2009 OK all the scripts are working, but now I can use the code as many times as I want! Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 13, 2009 Share Posted July 13, 2009 Check to see if the inis are updating. Link to comment Share on other sites More sharing options...
Merchant Posted July 13, 2009 Author Share Posted July 13, 2009 I checked, they're not… Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 13, 2009 Share Posted July 13, 2009 Paste your ItemCodes.ini file for you (use Code tags). Link to comment Share on other sites More sharing options...
Merchant Posted July 13, 2009 Author Share Posted July 13, 2009 Found the issue! 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