عرض مشاركة واحدة
قديم 03-05-2013, 07:40 AM   #1

Mad_General
عضو جديد



الصورة الرمزية Mad_General


• الانـتـسـاب » Apr 2013
• رقـم العـضـويـة » 111304
• المشـــاركـات » 26
• الـدولـة » ^^ مـصـر ^^
• الـهـوايـة » Hacking - BackTrack - SilkRoad
• اسـم الـسـيـرفـر » Thebes
• الـجـنـس » Male
• نقـاط التقييم » 10
Mad_General صـاعـد

Mad_General غير متواجد حالياً


إرسال رسالة عبر Yahoo إلى Mad_General

افتراضي



اهلااا اهلااا اهلاااا بالبرمجه وسنينهااا

منورين يارجااله ياريت لو حد يتاابع واحنا ان شاء الله نعمل اجدعها بوت

بسم الله نبتدى ... دى شوية اكوااد انا عملتهاا ياريت لو حد بيفهم اووى فى البرمجه
يقولى فيها غلط او لا ولو فى غلط او تعديل يقولى هو ايه وانا خلصت كل حاجه البوت
زى الفل وجاهز ولو عايزينى ارفع الاكواد انا جاهز بس المشكله فى كام حاجه بس كدااا

بسم الله توكلنا على الله ...

FindTarget

كود:
Namespace bot
    Module mFindTarget

        Dim closestDist As Int32
        Dim objectid As Int32
        Function findTarget() As Int32

            closestDist = 20000 'reset
            objectid = -1




            Do
                For Each mob As cMob In mobList.Values
                    'If mob.mobTyp = 0 Then
                    cheackTarget(mob)
                    'End If
                Next
                Threading.Thread.Sleep(50)
            Loop Until objectid <> -1

            Return objectid

        End Function




        Function cheackTarget(ByVal mob As cMob) 'check if the target is falid

            If mob.ignore = True Then Exit Function
            If mob.alive = False Then Exit Function
            If myConfig.KillSteal = False Then
                If mob.unterAttack IsNot Nothing Then
                    If mob.unterAttack.Count <> 0 Then Exit Function
                End If
            End If

            Dim distanz As Int32 = calcDist(myChar.Movement.currentPos, mob.Movement.currentPos)
            If distanz > closestDist Then
                Exit Function
            End If

            closestDist = distanz

            objectid = mob.objectid
            If objectid = 0 Then
                MsgBox("")
            End If
        End Function

 



    End Module
End Namespace
Pickup

كود:
Namespace bot
    Module mPickup


        Function getclosest_item() As Int32
            Dim itemfound As Int32 = -1
            Dim distanz As Int32 = 30000
            Dim tempdist As Int32
            If lockItemList() = False Then
                Exit Function
            End If
            Dim _itemList As cItem() = itemList.Values.ToArray
            unlockItemList()

            For Each item As cItem In _itemList
                If item.owner = myChar._accID Then
                    tempdist = calcDist(myChar.Movement.currentPos, item.position)
                    If distanz > tempdist Then
                        distanz = tempdist
                        itemfound = item.objectid
                    End If
                End If
            Next
            Return itemfound
        End Function




        Public Sub pickItems()
            ' Dim _itemlist As Hashtable = gVar.itemlist.Clone


            Dim itemfound As Int32 = getclosest_item()

            If myConfig.itempickmobcheck <> 0 Then
                If itemfound <> -1 Then
                    Dim mobfound As Int32 = checkifmobaround(itemfound)
                    If mobfound <> -1 Then
                        Do Until mTargetMob.target(mobfound)
                            Threading.Thread.Sleep(1000)
                        Loop
                        Exit Sub
                    End If
                End If
            Else

            End If

            If itemfound = -1 Then
                Exit Sub
            Else
                pickupitem(itemfound)
            End If

            pickItems()



        End Sub

        Function checkifmobaround(ByVal itemid As Int32) As Int32
            Dim mobFound As Boolean = False
            Dim item As cItem = itemlist(itemid)

            For Each mob As cMob In moblist.Values
                If mob.alive = True Then
                    'Console.WriteLine(calcDist(mob.Movement.currentPos, item.position))
                    If calcDist(mob.Movement.currentPos, item.position) < myConfig.itempickmobcheck Then
                        Return mob.objectid
                        Exit Function
                    End If
                End If
            Next

            Return -1
        End Function

        Sub pickupitem(ByVal itemid As Int32)
            IjectPickUp(itemid)
            Do
                If itemList.ContainsKey(itemid) = False Then
                    Exit Sub
                End If
                Threading.Thread.Sleep(50)
            Loop Until myChar.castQ.skillQ(cCastQ.enumSkillQ.first).Skill.id = 0 And myChar.castQ.paddingSkills.Count = 0

        End Sub

        Sub IjectPickUp(ByVal target As Int32)
            Log_BotAction("pickup--> " & fixdata.itemDataList(itemList.Item(target).objectTypID).name)
            Dim packet As Byte() = {7, 0, &HCD, &H72, 2, 0, _
                                    1, 2, 1, _
                                    0, 0, 0, 0}
            BitConverter.GetBytes(target).CopyTo(packet, 9)
            myChar.castQ.add(&HFFFE)
            connection.sendpacket(packet)
        End Sub



    End Module
End Namespace
cConnection

كود:
Public Class cConnection

    Dim _Connection As Net.Sockets.TcpClient
    Dim _ReadDataThread As Threading.Thread
    Dim _Port As Int32

    Sub New(ByVal port As Int32)
        _Port = port
    End Sub

    Function start() As String
        Try
            _ReadDataThread = New Threading.Thread(AddressOf readData)
            _Connection = New Net.Sockets.TcpClient
            _Connection.Connect("127.0.0.1", _Port)
            _ReadDataThread.Start()

        Catch ex As Exception
            Return ex.Message
        End Try
        Return "Connection: OK"
    End Function

    Sub close()
        _ReadDataThread.Abort()
        _Connection.Close()
    End Sub


    Dim packet As sPacket
    Sub readData()
        Dim bytetoread As UInt16
        Do
            Do
                bytetoread = _Connection.Available
                If bytetoread >= 6 Then
                    Dim buffer(6 - 1) As Byte
                    _Connection.Client.Receive(buffer, 6, Net.Sockets.SocketFlags.None)
                    packet = New sPacket
                    packet.len = BitConverter.ToUInt16(buffer, 0)
                    packet.opc = BitConverter.ToUInt16(buffer, 2)
                    packet.dest = BitConverter.ToUInt16(buffer, 4)
                    Exit Do
                Else
                    Threading.Thread.Sleep(10)
                End If
            Loop

            Do
                bytetoread = _Connection.Available
                If bytetoread >= packet.len Then
                    Dim buffer(packet.len - 1) As Byte
                    _Connection.Client.Receive(buffer, packet.len, Net.Sockets.SocketFlags.None)
                    packet.data = buffer
                    opcSwitch(packet)
                    Exit Do
                Else
                    Threading.Thread.Sleep(10)
                End If
                opcSwitch(packet)
            Loop

        Loop
    End Sub






    Public Sub sendpacket(ByVal data() As Byte)
        _Connection.Client.Send(data)
    End Sub









End Class
انا كل حاجه موجوده معايا بس مش عارف اذا كانت صح او غلط محتااج حد محترف اوووى
انا اخدت وقت كبيير اووووى على ماعملت كل الحاجات دى
كنت بامشى مع شروحات واحده واحده وملف ملف وبافتح سورسات كتير علشان افهم اتعملت ازاى

ياريت بس حد يوجههنى ويقولى الغلط والحاجات اللى لازم اعملها
وعلى فكره الفورمات لسا مش جاهزة يعنى اى هبل كدا وخلااص فمحدش يطلب صور دلوقتى :)


توقيع Mad_General :

♥.. أطـهَـر أنـواع الــحُــبْ
انْ تُحِـبَ شَخْصـاً وأنـتَ تعْــلمْ أنـّهُ لَـن يَكـونَ مُـلـكَك ولا مِـن نصـيبك
وَلكـن تـبقى تُحـبّهْ وَتُحِـــبْ أنْ تَــراهُ سَــعِـيداً فقــط لأنّــك » تُحِــبُّــه..♥





إعلانات google