Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Action bar!


zade_o
 Share

Recommended Posts

packets are very simple:

server decides something needs to happen. it makes a new string.

gives it a header
ie
mysuperspellbarholds

then give it the data
ie
1,5,8,2,5,4,0,0

with it all seperated using sep_char and finished with an end_char.

so your string packet might look like this:
packet = mysuperspellbarholds & sep_char & spelldata1variableloadedfromini & sep_char & spelldata2variableloadedfromini & sep_char …. etc etc

the client then gets a new case in modhandletcp for the header
mysuperspellbarholds
that tells it what to do with the info it recieves, in this case update the images in the spellbar.
Link to comment
Share on other sites

right I got packets …somewhat...that's how i've been building the action bar, but i don't know how to make the packets send automatically when the form loads..

```
    If casestring = "getspell7" Then

        s = parse(1)
        frmMirage.Label14(7).Caption = s
        frmMirage.Image13.Picture = LoadPicture(App.Path & "\GUI\SpellIcons\" & s & ".gif")
    End If
```
This is an example of one of the packets in my client, and this is what's in my server

```
        Case "setspell7"
            Call WriteINI("SK7", "sid", Parse(1), App.Path & "\Scripts\db\" & GetPlayerName(Index) & ".ini")
            Exit Sub

        Case "loadspell7"
            FileData = ReadINI("SK7", "sid", App.Path & "\Scripts\db\" & GetPlayerName(Index) & ".ini", vbNullString)
            Call SendDataTo(Index, "getspell7" & SEP_CHAR & FileData & END_CHAR)
            Exit Sub
```
I don't know how to mold this to update all 10 slots when frmMirage loads.
Link to comment
Share on other sites

find where the server sends the motd, add after it

> FileData = ReadINI("SK7", "sid", App.Path & "\Scripts\db\" & GetPlayerName(Index) & ".ini", vbNullString)
> Call SendDataTo(Index, "getspell7" & SEP_CHAR & FileData & END_CHAR)

for each action slot is the fastest and dirtiest way.
Link to comment
Share on other sites

ohhh. sounds good. i'll try that out real fast

EDIT-
Worked like a charm.

progress:
(DONE)- add in the code for the other 7 slots
(actually not done….see below...lol)- put a check in that keeps you from putting the same spell in spell bar more than once
- copy the codes from left clicking to hitting numbers
(DONE)- figure out how to make your icons load when you load the form

Ok so, my method of checking to see if you already have the spell was gonna be to check if the image of sayyy

Image7 =  App.Path & "\GUI\SpellIcons\" & spellname & ".gif" Then
exists = true

but doesn't work? any ideas on how to check to see if it exists in any of the slots?
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...