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

A simple code that Newbies can learn of


anasky
 Share

Recommended Posts

Hello all,
I'm going to show you a pretty simple code that I used to teach someone that asked me the basics.

Client: form1.frm
```
Private Sub cmdFlee_Click()
      Call SendData("flee" & END_CHAR)
End Sub

```
Server: modHandleData.bas
```
Case "flee"
      Dim X As Integer
      X = Rand(1, 100)
      If X => 80 Then
              Call SendDataTo(Index, "flee" & END_CHAR)
              Call PlayerMsg(Index, "You succeeded to flee.", GREEN)
      End If
Exit Sub

```
Client: modHandleData.bas
```
If parse(0) = "flee" Then
      Unload form1
Exit Sub
End If

```

I hope you guys liked it.
Link to comment
Share on other sites

@Anasky:

> Hello all,
> I'm going to show you a pretty simple code that I used to teach someone that asked me the basics.
>
> Client: form1.frm
> ```
> Private Sub cmdFlee_Click()
>        Call SendData("flee" & END_CHAR)
> End Sub
>
> ```
> Server: modHandleData.bas
> ```
> Case "flee"
>        Dim X As Integer
>        X = Rand(1, 100)
>        If X => 80 Then
>               Call SendDataTo(Index, "flee" & END_CHAR)
>               Call PlayerMsg(Index, "You succeeded to flee.", GREEN)
>        End If
> Exit Sub
>
> ```
> Client: modHandleData.bas
> ```
> If parse(0) = "flee" Then
>        Unload form1
> Exit Sub
> End If
>
> ```
>
> I hope you guys liked it.

You should have also included that this only works if you make a command button in vb6 named "cmdFlee" and that when you click it, it sends a packet to the server that chooses a random number and when it's 81~100 then the server sends another packet back to the client to tell it to close the form named "form1"
Link to comment
Share on other sites

@unnown:

> its a really basic message/unload form thingy

True, but if you only know how to make a form etc, it's quite good to get Eclipse a bit :P
The previous guy I showed it (in RL) was busy for an hour to figure out what it did xD
Link to comment
Share on other sites

@MrMiguuâ„¢:

> I'm guessing he doesn't know VB6…

lol, I didn't made this for nothing xD
It sends a packet to the server (SendData),
Creates an integer (Dim X As Integer)
Server makes a random (in server to avoid CheatEngine) (X = Rand(1, 100)),
If it's higher then or equal to 80 (If X => 80 Then),
Sends a packet to the Client (SendDataTo),
Client unloads form1 (Basically, it gets the form1 (in my case, the battle view) away from view).
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...