Snoozey Posted April 24, 2012 Share Posted April 24, 2012 @Joost:> Did you add a file named Guildlist.txt in the guilds folder? Not sure if the code actually sets up the text if none if found.Yes, I am sure. The path is correct, and no the code will not create the list. I was doing that after I got this to work. Something is really messed up.The .dat files are not creating anymore.Found the issue with the dat files. Got them working again, however it is not writing into the txt file still.It is writing in the file, but it is only adding returns. No text just new lines, it is also not checking. I added a guild name is manually it still allowed me to make it again in game. Link to comment Share on other sites More sharing options...
Joost Posted April 24, 2012 Share Posted April 24, 2012 ``` 'Check to see if guild name exists. If not Write to file If FindGuild(True) Then PlayerMsg Founder_Index, "That Guild name already exists!", BrightRed Exit Sub End If 'Write to text file to save guild name. Call SaveGuild(Guildname)```This sub is still broken. FindGuild(True) is not working because it needs to be FindGuild(Whatever variable is defined as the guild name) and SaveGuild(Guildname) should be SaveGuild(Whatever variable is defined as the guild name). I dont know what variable stores the guild name so youll have to find that yourself. Link to comment Share on other sites More sharing options...
Snoozey Posted April 24, 2012 Share Posted April 24, 2012 @Joost:> ```> 'Check to see if guild name exists. If not Write to file> If FindGuild(True) Then> PlayerMsg Founder_Index, "That Guild name already exists!", BrightRed> Exit Sub> End If> > 'Write to text file to save guild name.> Call SaveGuild(Guildname)> ```This sub is still broken. FindGuild(True) is not working because it needs to be FindGuild(Whatever variable is defined as the guild name) and SaveGuild(Guildname) should be SaveGuild(Whatever variable is defined as the guild name). I dont know what variable stores the guild name so youll have to find that yourself.Wouldent this be the guild name variable? GuildData(GuildSlot).Guild_Name = name. Still looking as that one did not work. Link to comment Share on other sites More sharing options...
Joost Posted April 24, 2012 Share Posted April 24, 2012 Sounds about right. Link to comment Share on other sites More sharing options...
Snoozey Posted April 24, 2012 Share Posted April 24, 2012 @Joost:> Sounds about right.``` 'Check to see if guild name exists. If not Write to file If FindGuild(GuildData.Guild_Name) Then PlayerMsg Founder_Index, "That Guild name already exists!", BrightRed Exit Sub End If 'Write to text file to save guild name. Call SaveGuildName(GuildData.Guild_Name)```Compile error:Invalid qualifer Link to comment Share on other sites More sharing options...
Joost Posted April 24, 2012 Share Posted April 24, 2012 GuildData.Guild_Name is wrong Link to comment Share on other sites More sharing options...
Snoozey Posted April 24, 2012 Share Posted April 24, 2012 @Joost:> GuildData.Guild_Name is wrongError 13 type mismatch``` Call SaveGuildName(name)```I have the name checking working, just not the writing. Continuing to test it. Link to comment Share on other sites More sharing options...
Joost Posted April 24, 2012 Share Posted April 24, 2012 Guildname is a string, not a number Link to comment Share on other sites More sharing options...
Snoozey Posted April 24, 2012 Share Posted April 24, 2012 @Joost:> Guildname is a string, not a numberI think I edited before you posted. It is now correctly getting the guild name, but it is still giving me an error 13 type mis match. name is a stringOk, I now have it working almost completely. I changed long into string so now they are both strings.However, If I have two guild names lets sayTestme1Testme2That is how the text file should look. However it looks likeTestme1testme2I need it to place a return. Working on it now. Link to comment Share on other sites More sharing options...
Joost Posted April 24, 2012 Share Posted April 24, 2012 You changed it into```Sub SaveGuild(ByVal Guildname As String)```? Link to comment Share on other sites More sharing options...
Snoozey Posted April 24, 2012 Share Posted April 24, 2012 @Joost:> You changed it into> ```> Sub SaveGuild(ByVal Guildname As String)> > ```?Actually because I am a derp Guildname already exists. I fixed this a few posts back. here is the complete code. Pretty sure 100% working.```Sub SaveGuildName(ByVal name As String) Dim F As Long Dim n As Long F = FreeFile Open App.Path & "\data\guilds\Guildlist.txt" For Append As #F Print #F, name; "" Close #FEnd Sub``````Function FindGuild(ByVal name As String) As Boolean Dim F As Long Dim s As String F = FreeFile Open App.Path & "\data\guilds\Guildlist.txt" For Input As #F Do While Not EOF(F) Input #F, s If Trim$(LCase$(s)) = Trim$(LCase$(name)) Then FindGuild = True Close #F Exit Function End If Loop Close #FEnd Function`````` 'Check to see if guild name exists. If FindGuild(name) Then PlayerMsg Founder_Index, "That Guild name already exists!", BrightRed Exit Sub End If`````` 'Write to text file to save guild name. Call SaveGuildName(name)```Makes guild list if guild list is not there. This is in initserver``` ' Check if the master Guildlist file exists for checking duplicate names, and if it doesnt make it If Not FileExist("data\guilds\Guildlist.txt") Then F = FreeFile Open App.Path & "\data\guilds\Guildlist.txt" For Output As #F Close #F End If```Before I forget I would like to thank you. It must of been frustrating trying to help me, but I feel as though I learned quite a bit.Now I am working on it deleting out of the text file when the guild disbands. I have a feeling the deleting will be very hard…Stuck on the deleting part. No errors thrown, however nothing is deleted.```Sub DeleteGuild(ByVal name As String) Dim f1 As Long Dim f2 As Long Dim s As String Call FileCopy(App.Path & "\data\guilds\Guildlist.txt", App.Path & "\data\guilds\Guildtemp.txt") ' Destroy name from Guild List f1 = FreeFile Open App.Path & "\data\guilds\Guildtemp.txt" For Input As #f1 f2 = FreeFile Open App.Path & "\data\guilds\Guildlist.txt" For Output As #f2 Do While Not EOF(f1) Input #f1, s If Trim$(LCase$(s)) <> Trim$(LCase$(name)) Then Print #f2, s End If Loop Close #f1 Close #f2 Call Kill(App.Path & "\data\guilds\Guildtemp.txt")End Sub```Got it to work :] Thanks for the help.Anyone feel free to use the code or add it to the tutorial. Link to comment Share on other sites More sharing options...
Scott Posted April 30, 2012 Author Share Posted April 30, 2012 * Changed all player name checks over to CheckPlayerName Function [ ]* Added Bug fix to main downloads [X]* Finished adding Color guild names [ ]* Fixed lowercase guildnames [ ]* Added a /Lookup command to look up both players/guilds [ ]* Added Guild Rank to guildchat messages [ ]* Guilds cannot have the same name anymore [ ]* Admin tool for removing/changing Guilds/Guild Names [ ] Link to comment Share on other sites More sharing options...
waseemk Posted May 2, 2012 Share Posted May 2, 2012 @Snoozey:> Actually because I am a derp Guildname already exists. I fixed this a few posts back. here is the complete code. Pretty sure 100% working.> > ```> Sub SaveGuildName(ByVal name As String)> Dim F As Long> Dim n As Long> F = FreeFile> Open App.Path & "\data\guilds\Guildlist.txt" For Append As #F> Print #F, name; ""> > Close #F> End Sub> ```> ```> Function FindGuild(ByVal name As String) As Boolean> Dim F As Long> Dim s As String> F = FreeFile> Open App.Path & "\data\guilds\Guildlist.txt" For Input As #F> > Do While Not EOF(F)> Input #F, s> > If Trim$(LCase$(s)) = Trim$(LCase$(name)) Then> FindGuild = True> Close #F> Exit Function> End If> > Loop> > Close #F> End Function> ```> ```> 'Check to see if guild name exists.> If FindGuild(name) Then> PlayerMsg Founder_Index, "That Guild name already exists!", BrightRed> Exit Sub> End If> ```> ```> 'Write to text file to save guild name.> Call SaveGuildName(name)> ```> Makes guild list if guild list is not there. This is in initserver> ```> ' Check if the master Guildlist file exists for checking duplicate names, and if it doesnt make it> If Not FileExist("data\guilds\Guildlist.txt") Then> F = FreeFile> Open App.Path & "\data\guilds\Guildlist.txt" For Output As #F> Close #F> End If> ```Before I forget I would like to thank you. It must of been frustrating trying to help me, but I feel as though I learned quite a bit.> > Now I am working on it deleting out of the text file when the guild disbands. I have a feeling the deleting will be very hard…> > Stuck on the deleting part. No errors thrown, however nothing is deleted.> ```> Sub DeleteGuild(ByVal name As String)> Dim f1 As Long> Dim f2 As Long> Dim s As String> Call FileCopy(App.Path & "\data\guilds\Guildlist.txt", App.Path & "\data\guilds\Guildtemp.txt")> ' Destroy name from Guild List> f1 = FreeFile> Open App.Path & "\data\guilds\Guildtemp.txt" For Input As #f1> f2 = FreeFile> Open App.Path & "\data\guilds\Guildlist.txt" For Output As #f2> > Do While Not EOF(f1)> Input #f1, s> > If Trim$(LCase$(s)) <> Trim$(LCase$(name)) Then> Print #f2, s> End If> > Loop> > Close #f1> Close #f2> Call Kill(App.Path & "\data\guilds\Guildtemp.txt")> End Sub> ```> Got it to work :] Thanks for the help.> > Anyone feel free to use the code or add it to the tutorial.Where do i put these codes Link to comment Share on other sites More sharing options...
LucasLopo Posted May 10, 2012 Share Posted May 10, 2012 Would cause the owner of the guild when banished to pass to another guild member stronger or higher rank? Link to comment Share on other sites More sharing options...
Scott Posted May 10, 2012 Author Share Posted May 10, 2012 The founder(as I called it in this) is not able to leave the guild unless they,1)Transfer the founder status to another member with the **/guild founder (name)** commandor2)Disband the guild which deletes the guild completely. Link to comment Share on other sites More sharing options...
Stein Posted May 16, 2012 Share Posted May 16, 2012 A very nicely written base indeed. I've been porting all the features over from a seperate admin screen and some commands to a fully UI driven system and so far it's been fairly easy to track everything you've written and what needs to be changed.. And the missing color change seems like an easy enough task to implement! Link to comment Share on other sites More sharing options...
quintensky Posted May 17, 2012 Share Posted May 17, 2012 Is this Graphical, or only commands? Link to comment Share on other sites More sharing options...
Scott Posted May 19, 2012 Author Share Posted May 19, 2012 The guild admin panel that guild leaders use is graphical, everything else is command only. Link to comment Share on other sites More sharing options...
quintensky Posted May 19, 2012 Share Posted May 19, 2012 hmm guess i'll just w8 to implement this until i know more about VB6 so i can make it graphical Link to comment Share on other sites More sharing options...
erkro1 Posted May 20, 2012 Share Posted May 20, 2012 @quintensky:> hmm guess i'll just w8 to implement this until i know more about VB6 so i can make it graphicalWell, the whole admin panel is already 'graphical' so you only need to make some kind of Guild Admin Panel where you can invite users, open the guild panel etc. Link to comment Share on other sites More sharing options...
quintensky Posted May 22, 2012 Share Posted May 22, 2012 @Scott:> * Changed all player name checks over to CheckPlayerName Function [ ]> * Added Bug fix to main downloads [X]> * Finished adding Color guild names [ ]> * Fixed lowercase guildnames [ ]> * Added a /Lookup command to look up both players/guilds [ ]> * Added Guild Rank to guildchat messages [ ]> * Guilds cannot have the same name anymore [ ]> * Admin tool for removing/changing Guilds/Guild Names [ ]does the X mean: check! (as in done)or: still to be done (kinda confusing ;) Link to comment Share on other sites More sharing options...
Scott Posted May 23, 2012 Author Share Posted May 23, 2012 It's not uploaded to eclipse yet, I realize that can be a little confusing sorry. Link to comment Share on other sites More sharing options...
quintensky Posted May 23, 2012 Share Posted May 23, 2012 someone beat me to it… see the ''Additions'' part of this tutorial Link to comment Share on other sites More sharing options...
Scott Posted May 27, 2012 Author Share Posted May 27, 2012 @quintensky:> implemented, works good, now i just gotta make every command graphical, as in:> commands = gone> buttons = replacementThanks to another eclipse user there is now a tutorial for this!http://www.touchofdeathforums.com/smf2/index.php/topic,80414.msg860819.html#msg860819 Link to comment Share on other sites More sharing options...
quintensky Posted May 27, 2012 Share Posted May 27, 2012 i noticed :pi love him, check out my reply to that tut :P 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