Driocku Posted June 13, 2009 Author Share Posted June 13, 2009 Since I've never been good with the server and client connections thing I need help with having it get data, for a roster pokemon thing.```If casestring = "rostdata" Then n = 1 If PIP = 0 Then ElseIf PIP = 1 Then Poke = Val(parse(n)) Name = Val(parse(n + 1)) Shiny = Val(parse(n + 2)) lvl = Val(parse(n + 3)) Expe = Val(parse(n + 4)) MHp = Val(parse(n + 5)) CHp = Val(parse(n + 6)) ElseIf PIP = 2 Then Poke = Val(parse(n)) Name = Val(parse(n + 1)) Shiny = Val(parse(n + 2)) lvl = Val(parse(n + 3)) Expe = Val(parse(n + 4)) MHp = Val(parse(n + 5)) CHp = Val(parse(n + 6))```Theres more data but this just for the display when a player clicks the roster, All 6 pokemon in a roster are under the same .INI file and I want to know how to Get the data from under a certain section of the .INI file or would I have to go from Poke to Poke1 to Poke 2, also is that code so far correct(has no Idea what hes talking about anymore Link to comment Share on other sites More sharing options...
anasky Posted June 13, 2009 Share Posted June 13, 2009 example:Call SendData("driocku" & SEP_CHAR & "test" & END_CHAR)Server:modHandleData:Case "driocku" If parse(1) = "test" Then Call SendDataTo(Index, "driocku2" & END_CHAR) End If Exit SubClient:modHandleData:If parse(0) = "driocku2" Then frm_Driocku.Show Exit SubEnd IfIf you'd like another example, check my threat in Tutorials –> A code newbies can learn of (page 2) Link to comment Share on other sites More sharing options...
Driocku Posted June 13, 2009 Author Share Posted June 13, 2009 Thank you anasky, and I noticed you closed down your pokemon game, also that only answered part of my questionthis is what My .INI file looks like , I need to know if I can get data from both without having to change the seconds variable names```[Pok1]Poke=001Name=LeafyShiny=0Lvl=15Nature=0Bound=0Expe=2000Item=009@@@@@@@@@@@@@@@@MOVE@@@@@@@@@@@@@@@@Move1=001Move2=001Move3=001Move4=001@@@@@@@@@@@@@@@@STAT@@@@@@@@@@@@@@@@SE=MHp=90CHp=90Atk=130Def=130Sp.Atk=180Sp.Def=180Spd=150Points=[Pok2]Poke=Name=Shiny=Lvl=Nature=Bound=Expe=Item=@@@@@@@@@@@@@@@@MOVE@@@@@@@@@@@@@@@@Move1=Move2=Move3=Move4=@@@@@@@@@@@@@@@@STAT@@@@@@@@@@@@@@@@SE=MHp=CHp=Atk=Def=Sp.Atk=Sp.Def=Spd=Points=``` Link to comment Share on other sites More sharing options...
PD Posted June 13, 2009 Share Posted June 13, 2009 use GetVar to get data from an .ini fileGetVar(File As String, Header As String, Var As String) Link to comment Share on other sites More sharing options...
milkyrules Posted June 13, 2009 Share Posted June 13, 2009 hope my shout helped get your question faster Draiko :azn: Link to comment Share on other sites More sharing options...
Driocku Posted June 13, 2009 Author Share Posted June 13, 2009 Another question what would the code be to retrieve data from the header and store that in something and then send it to the client Link to comment Share on other sites More sharing options...
PD Posted June 13, 2009 Share Posted June 13, 2009 Data = GetVar(File As String, Header As String, Var As String)Dim Packet as stringPacket = "" & sep_char & index & sep_char & data & sep_char & end_charcall senddatato(index, Packet) Link to comment Share on other sites More sharing options...
Driocku Posted June 13, 2009 Author Share Posted June 13, 2009 How would i use this to send Multiple variables Link to comment Share on other sites More sharing options...
PD Posted June 13, 2009 Share Posted June 13, 2009 Data = GetVar(File As String, Header As String, Var As String)Data1 = GetVar(File As String, Header As String, Var As String)Dim Packet as stringPacket = "" & Sep_Char & index & Sep_Char & Data & Sep_Char & Data1 & Sep_Char & End_CharCall SendDataTo(index, Packet)all u got 2 do iz use Sep_Char to seperate the data/variables Link to comment Share on other sites More sharing options...
Driocku Posted June 13, 2009 Author Share Posted June 13, 2009 Can I use parse or something instead of dataClient Send thing-```Private Sub btnParty_Click() Call SendData("rostrequest" & END_CHAR) frmRoster.ShowEnd Sub```Client recieve-``` If casestring = "Packet_Roster" Then Dim Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11 As String If Data6 = 1 Then frmRoster.ripOmegaImage1 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Data0 & ".png") Else frmRoster.ripOmegaImage1 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Data0 & ".png") End If If Data7 = 1 Then frmRoster.ripOmegaImage2 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Data1 & ".png") Else frmRoster.ripOmegaImage2 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Data1 & ".png") End If If Data8 = 1 Then frmRoster.ripOmegaImage3 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Data2 & ".png") Else frmRoster.ripOmegaImage3 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Data2 & ".png") End If If Data9 = 1 Then frmRoster.ripOmegaImage4 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Data3 & ".png") Else frmRoster.ripOmegaImage4 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Data3 & ".png") End If If Data10 = 1 Then frmRoster.ripOmegaImage5 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Data4 & ".png") Else frmRoster.ripOmegaImage5 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Data4 & ".png") End If If Data11 = 1 Then frmRoster.ripOmegaImage6 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Data5 & ".png") Else frmRoster.ripOmegaImage6 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Data5 & ".png") End If```Server code-``` Case "rostrequest" Dim Packet_Roster As String Dim Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11 As String Data0 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok1", "Poke") Data1 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok2", "Poke") Data2 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok3", "Poke") Data3 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok4", "Poke") Data4 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok5", "Poke") Data5 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok6", "Poke") Data6 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok1", "Shiny") Data7 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok2", "Shiny") Data8 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok3", "Shiny") Data9 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok4", "Shiny") Data10 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok5", "Shiny") Data11 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok6", "Shiny") Packet_Roster = "" & SEP_CHAR & Index & SEP_CHAR & Data & SEP_CHAR & Data1 & SEP_CHAR & Data2 & SEP_CHAR & Data3 & SEP_CHAR & Data4 & SEP_CHAR & Data5 & SEP_CHAR & Data6 & SEP_CHAR & Data7 & SEP_CHAR & Data8 & SEP_CHAR & Data9 & SEP_CHAR & Data10 & SEP_CHAR & Data11 & SEP_CHAR & END_CHAR Call SendDataTo(Index, Packet_Roster) Exit Sub``` Link to comment Share on other sites More sharing options...
PD Posted June 13, 2009 Share Posted June 13, 2009 u can use anything i was using data as an example Link to comment Share on other sites More sharing options...
Driocku Posted June 13, 2009 Author Share Posted June 13, 2009 and the above code doesn't work properly, its supposed to get the data from a ini on the server and send it over, after which the client takes the data and gets an image from a file then it should display it ina picture box but it won't for some reason Link to comment Share on other sites More sharing options...
PD Posted June 13, 2009 Share Posted June 13, 2009 Packet_Roster = "Packet_Roster" & SEP_CHAR & Index & SEP_CHAR & Data & SEP_CHAR & Data1 & SEP_CHAR & Data2 & SEP_CHAR & Data3 & SEP_CHAR & Data4 & SEP_CHAR & Data5 & SEP_CHAR & Data6 & SEP_CHAR & Data7 & SEP_CHAR & Data8 & SEP_CHAR & Data9 & SEP_CHAR & Data10 & SEP_CHAR & Data11 & SEP_CHAR & END_CHAR Link to comment Share on other sites More sharing options...
Driocku Posted June 13, 2009 Author Share Posted June 13, 2009 It still doesn't display the image in the picture box even after fixing that, is there anything else wrong with that code??? Link to comment Share on other sites More sharing options...
PD Posted June 13, 2009 Share Posted June 13, 2009 u hav to parse d datadata = parse(1)data1 = parse(2)and so on Link to comment Share on other sites More sharing options...
Driocku Posted June 13, 2009 Author Share Posted June 13, 2009 ok, done that and the image still doesn't display inside the picture box for some reason Link to comment Share on other sites More sharing options...
PD Posted June 13, 2009 Share Posted June 13, 2009 if ur using d normal image control or picture box, dey dont support .png images Link to comment Share on other sites More sharing options...
Driocku Posted June 13, 2009 Author Share Posted June 13, 2009 Yea I figured that out and the only way to use png is with Reeaaaallly long codeServer side code-``` Case "rostrequest" Dim Packet_Roster As String Dim Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11 As String Data0 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok1", "Poke") Data1 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok2", "Poke") Data2 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok3", "Poke") Data3 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok4", "Poke") Data4 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok5", "Poke") Data5 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok6", "Poke") Data6 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok1", "Shiny") Data7 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok2", "Shiny") Data8 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok3", "Shiny") Data9 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok4", "Shiny") Data10 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok5", "Shiny") Data11 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok6", "Shiny") Data0 = Parse(1) Data1 = Parse(2) Data2 = Parse(3) Data3 = Parse(4) Data4 = Parse(5) Data5 = Parse(6) Data6 = Parse(7) Data7 = Parse(8) Data8 = Parse(9) Data9 = Parse(10) Data10 = Parse(11) Data11 = Parse(12) Packet_Roster = "Packet_Roster" & SEP_CHAR & Index & SEP_CHAR & Data & SEP_CHAR & Data1 & SEP_CHAR & Data2 & SEP_CHAR & Data3 & SEP_CHAR & Data4 & SEP_CHAR & Data5 & SEP_CHAR & Data6 & SEP_CHAR & Data7 & SEP_CHAR & Data8 & SEP_CHAR & Data9 & SEP_CHAR & Data10 & SEP_CHAR & Data11 & SEP_CHAR & END_CHAR Call SendDataTo(Index, Packet_Roster) Exit Sub```Current Client side code-(not all are bmp since I'm a bit lazy and I'm only using 1st as test)``` If casestring = "Packet_Roster" Then If Parse(7) = 1 Then frmRoster.ripOmegaImage1.Picture = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(1) & ".bmp") Else frmRoster.ripOmegaImage1.Picture = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(1) & ".bmp") End If If Parse(8) = 1 Then frmRoster.ripOmegaImage2 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(2) & ".png") Else frmRoster.ripOmegaImage2 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(2) & ".png") End If If Parse(9) = 1 Then frmRoster.ripOmegaImage3 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(3) & ".png") Else frmRoster.ripOmegaImage3 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(3) & ".png") End If If Parse(10) = 1 Then frmRoster.ripOmegaImage4 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(4) & ".png") Else frmRoster.ripOmegaImage4 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(4) & ".png") End If If Parse(11) = 1 Then frmRoster.ripOmegaImage5 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(5) & ".png") Else frmRoster.ripOmegaImage5 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(5) & ".png") End If If Parse(12) = 1 Then frmRoster.ripOmegaImage6 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(6) & ".png") Else frmRoster.ripOmegaImage6 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(6) & ".png") End If End If```Ok I've gotten past most of the problems the one I'm currentely facing is a script out of range rte #9It has trouble reading more then Parse(0); I will post again if I can't fix by myself Link to comment Share on other sites More sharing options...
Pavilion Posted June 13, 2009 Share Posted June 13, 2009 hehe Bumb :P Link to comment Share on other sites More sharing options...
PD Posted June 13, 2009 Share Posted June 13, 2009 try dis``` Case "rostrequest" Dim Packet_Roster As String Dim Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11 As String Data0 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok1", "Poke") Data1 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok2", "Poke") Data2 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok3", "Poke") Data3 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok4", "Poke") Data4 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok5", "Poke") Data5 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok6", "Poke") Data6 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok1", "Shiny") Data7 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok2", "Shiny") Data8 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok3", "Shiny") Data9 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok4", "Shiny") Data10 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok5", "Shiny") Data11 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok6", "Shiny") Packet_Roster = "Packet_Roster" & SEP_CHAR & Index & SEP_CHAR & Data0 & SEP_CHAR & Data1 & SEP_CHAR & Data2 & SEP_CHAR & Data3 & SEP_CHAR & Data4 & SEP_CHAR & Data5 & SEP_CHAR & Data6 & SEP_CHAR & Data7 & SEP_CHAR & Data8 & SEP_CHAR & Data9 & SEP_CHAR & Data10 & SEP_CHAR & Data11 & SEP_CHAR & END_CHAR Call SendDataTo(Index, Packet_Roster) Exit Sub`````` If casestring = "Packet_Roster" ThenDim Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11 As StringData0 = parse(1)Data1 = parse(2)Data2 = parse(3)Data3 = parse(4)Data4 = parse(5)Data5 = parse(6)Data6 = parse(7)Data7 = parse(8)Data8 = parse(9)Data9 = parse(10)Data10 = parse(11)Data11 = parse(12) If Data7 = 1 Then frmRoster.ripOmegaImage1.Picture = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(1) & ".bmp") Else frmRoster.ripOmegaImage1.Picture = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(1) & ".bmp") End If If Data8 = 1 Then frmRoster.ripOmegaImage2 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(2) & ".png") Else frmRoster.ripOmegaImage2 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(2) & ".png") End If If Data9 = 1 Then frmRoster.ripOmegaImage3 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(3) & ".png") Else frmRoster.ripOmegaImage3 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(3) & ".png") End If If Data10 = 1 Then frmRoster.ripOmegaImage4 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(4) & ".png") Else frmRoster.ripOmegaImage4 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(4) & ".png") End If If Data11 = 1 Then frmRoster.ripOmegaImage5 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(5) & ".png") Else frmRoster.ripOmegaImage5 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(5) & ".png") End If If Data12 = 1 Then frmRoster.ripOmegaImage6 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(6) & ".png") Else frmRoster.ripOmegaImage6 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(6) & ".png") End If End If``` Link to comment Share on other sites More sharing options...
Driocku Posted June 13, 2009 Author Share Posted June 13, 2009 ```If Parse(0) = "Packet_Roster" Then```This works```If casestring = "Packet_Roster" Then```This doesnotand there are apparentely some issues with image loading but it doesn't really say Link to comment Share on other sites More sharing options...
PD Posted June 13, 2009 Share Posted June 13, 2009 well im out of ideas :P Link to comment Share on other sites More sharing options...
Driocku Posted June 13, 2009 Author Share Posted June 13, 2009 well i finally got it to work 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